From:             mathiasrav at gmail dot com
Operating system: WinXP
PHP version:      5.2.1
PHP Bug Type:     Feature/Change Request
Bug description:  Attempt to call undefined function gives a fatal error 
instead of recoverable

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 bug report at http://bugs.php.net/?id=40587&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=40587&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=40587&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=40587&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=40587&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=40587&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=40587&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=40587&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=40587&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=40587&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=40587&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=40587&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=40587&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=40587&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=40587&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=40587&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=40587&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=40587&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=40587&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=40587&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=40587&r=mysqlcfg

Reply via email to