note 109093 deleted from function.eval by danbrown
| From: | danbrown@php.net | Date: | Wed, 20 Jun 2012 14:48:20 +0000 |
| Subject: | note 109093 deleted from function.eval by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-188715@lists.php.net to get a copy of this message | ||
Note Submitter: alberto dot villar at vidactive dot com
----
Maxim, eval() may return a value other than NULL due to a return statement inside the string being
eval()uated. Thus concluding that "if not NULL then execution is not correct" is wrong ...
<$php
$exception = eval($strCode);
if ($exception === NULL)
// Successful execution
// No return, "return NULL;" or just "return;" inside $strCode
else if ($exception !== FALSE)
// Successful execution
// "return ...;" statement inside $strCode
else
// Execution was probably unsuccessful
// Either execution error or "return FALSE;" inside $strCode
?>