ID: 24135 Updated by: [EMAIL PROTECTED] Reported By: gk at proliberty dot com -Status: Open +Status: Closed Bug Type: Documentation problem Operating System: linux ; kernel 2.4.18 PHP Version: 4.3.2 New Comment:
This bug has been fixed in the documentation's XML sources. Since the online and downloadable versions of the documentation need some time to get updated, we would like to ask you to be a bit patient. Thank you for the report, and for helping us make our documentation better. "In case of fatal error in evaluated code, eval returns FALSE." Previous Comments: ------------------------------------------------------------------------ [2003-06-11 14:38:32] gk at proliberty dot com Description: ------------ The manual says: > In PHP 4, eval() returns NULL unless return() is called in the evaluated code... This is not true. PHP returns FALSE if a fatal error occurs. This is very important especially for CLI/SAPI applications which must often catch fatal errors and propogate them with exit(1). Reproduce code: --------------- <?php // FILE: test/test.php $x=eval(";"); echo "Non-Fatal Error Returns: "; if($x===FALSE) echo "FALSE\n"; if(is_null($x)) echo "NULL\n"; $x=eval("<?"); echo "Fatal Error Returns: "; if($x===FALSE) echo "FALSE\n"; if(is_null($x)) echo "NULL\n"; ?> Expected result: ---------------- OUTPUT: $ php test/test.php Non-Fatal Error Returns: NULL PHP Parse error: parse error in /usr/local/apache/htdocs/common/php/xmake_org/xobj/test/test.php(6) : eval()'d code on line 1 Fatal Error Returns: FALSE ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=24135&edit=1