ID: 40587
User updated by: mathiasrav at gmail dot com
Reported By: mathiasrav at gmail dot com
Status: Open
Bug Type: Feature/Change Request
Operating System: WinXP
PHP Version: 5.2.1
New Comment:
A little change to the description-section - PHP doesn't crash, it
simply halts script execution. The *script* "crashes".
Previous Comments:
------------------------------------------------------------------------
[2007-02-21 23:03:16] mathiasrav at gmail dot com
Description:
------------
If you try to call an undefined function, PHP raises an E_ERROR and
crashes - not a catchable E_RECOVERABLE_ERROR.
This isn't a problem for web-related scripts, but for
maintainence/shell-like scripts, this can be a help. I have a script
with an idle-loop that calls (includes) module-files, and if a change
to one of these has a typo, all socket connections and the like are
killed.
Reproduce code:
---------------
<?php
function returntrue(){return true;}
seterrorhandler('returntrue', E_RECOVERABLE_ERROR);
qweasd();
echo 'Carrying on...';
?>
Expected result:
----------------
The call to qweasd() should return false or null. If the programmer has
made the script able to recover from calls to unknown functions, he must
have written code that can tell the difference between the return code
from a known and an unknown function.
Actual result:
--------------
The script halts.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=40587&edit=1