Re: Dynamic/runtime object creation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Joe,

If you are careful, you can build a string of PHP and eval() it to create a new
class definition. I've done this before, but it was for the novelty more than
needed to actually use it.

I know for a fact that I have seen several projects for this on the web;
However, I tried doing a quick search and I was unable to find anything.
Figures. do:

Anyways, yes it is possible and people have done it before, but if I were going
down this path I would second guess myself as to if this was the best solution.
You should be able to get by with something simpler (and less time consuming to
develop and test). I recommend finding a different solution, but if this is
what _you_ need to do then who am I to tell you no?

Best of luck!
-KBear


Original Message Below:
Hi,
     forgive me if this is a complete noob question....
	What i want to do is create an object at runtime with members and methods based
on the result of queries from my db back end. is this (a) possible? or (b)
something i should get out of my head and go and find a better solution?
	basically is their a create_object() style function, and some
add_method() / add_member() style functions, that to allow me to instance things
dynamically at runtime.

sorry that i am not being to clear, but i hope you can get my gist, thanks in
advance to any help any of you can give me!

cheers
joe

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux