note 109093 added to function.eval
| From: | alberto dot villar at vidactive dot com | Date: | Wed, 20 Jun 2012 09:34:35 +0000 |
| Subject: | note 109093 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-188711@lists.php.net to get a copy of this message | ||
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
?>
----
Server IP: 80.64.47.13
Probable Submitter: 83.57.10.19
----
Manual Page -- http://www.php.net/manual/en/function.eval.php
Edit -- https://master.php.net/note/edit/109093
Del: integrated -- https://master.php.net/note/delete/109093/integrated
Del: useless -- https://master.php.net/note/delete/109093/useless
Del: bad code -- https://master.php.net/note/delete/109093/bad+code
Del: spam -- https://master.php.net/note/delete/109093/spam
Del: non-english -- https://master.php.net/note/delete/109093/non-english
Del: in docs -- https://master.php.net/note/delete/109093/in+docs
Del: other reasons-- https://master.php.net/note/delete/109093
Reject -- https://master.php.net/note/reject/109093
Search -- https://master.php.net/manage/user-notes.php