|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-02-21 23:06 UTC] mathiasrav at gmail dot com
[2007-02-21 23:20 UTC] derick@php.net
[2011-11-14 21:03 UTC] matteosistisette at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 15 17:00:01 2025 UTC |
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.