note 46585 added to function.eval
| From: | dev at kiwicore dot org | Date: | Sat, 16 Oct 2004 03:40:17 +0000 |
| Subject: | note 46585 added to function.eval | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-78637@lists.php.net to get a copy of this message | ||
Use this function to check syntax if you don't have PHP5. It has the same shortcomings as
php_check_syntax, in that it actually executes the code, so never run this on anything the public
would submit to your site.
list($success,$response) = encapsulatedEval($yourCode);
function encapsulatedEval($code){
ob_start();
eval($code);
$str = ob_get_contents();
ob_clean();
return array(empty($str),$str);
}
----
Manual Page -- http://www.php.net/manual/en/function.eval.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+46585
Delete -- http://master.php.net/manage/user-notes.php?action=delete+46585&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+46585&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+46585&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+46585&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+46585&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+46585&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+46585&report=yes
Search -- http://master.php.net/manage/user-notes.php