Re: How to use objects, variables in an eval() func ?
| From: | Shawn McKenzie | Date: | Tue, 10 Jun 2003 12:48:26 +0000 |
| Subject: | Re: How to use objects, variables in an eval() func ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-150896@lists.php.net to get a copy of this message | ||
Maybe: global $yourobject;
-Shawn
"Lpa" <lpasseb@numericable.fr> wrote in message
news:001701c32f21$183b6dc0$f9a6dc51@lpa...
Hi,
I have an eval which evaluate a block of code before echo the result on the
screen.. Here is the func :
function t_eval($texte) {
ob_start();
eval("?>".$texte);
$retval = ob_get_contents();
ob_end_clean();
return $retval;
}
But I use some objects for databases, ... and when i trying to execute this
code i have this text.
Fatal error: Call to a member function on a non-object in k:\program
files\easyphp\www\dhea\include\php\functions_conversion.inc.php(23) :
eval()'d code on line 9
What to do ?
Thanx
Laurent