Page 1 of 1

Pulling class definition from a database

Posted: Wed Jul 21, 2004 9:31 am
by kettle_drum
Was just wondering if anybody had any experience in pulling class definitions from a database and then calling them. Would doing an eval() on the result from the database be enough for php to parse the class and allow you to initilize it?

Thanks.

Posted: Wed Jul 21, 2004 10:40 am
by dledmonds
<?
eval( 'class testing { function testing() {} function hello() { echo( ''hello'' ); } }' );
$testing = new testing();
$testing->hello();
?>

worked fine when I tested it :)