note 46382 added to function.eval
| From: | mahaixing at hotmail dot com | Date: | Sat, 09 Oct 2004 03:49:02 +0000 |
| Subject: | note 46382 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78206@lists.php.net to get a copy of this message | ||
When using Dynamic Proxy design pattern we must create a class automaticly. Here is a sample code.
$clazz = "class SomeClass { var \$value = 'somevalue'; function show() { echo
get_class(\$this);}}";
eval($clazz);
$instance = new SomeClass;
// Here output 'somevalue';
echo $instance->value;
echo "<br>";
//Here output 'someclass'
$instance->show();
----
Manual Page -- http://www.php.net/manual/en/function.eval.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46382
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46382&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46382&report=yes
Search -- http://master.php.net/manage/user-notes.php