Req #63538 [NEW]: "Call to undefined function" should be catchable

From: Date: Fri, 16 Nov 2012 10:13:02 +0000
Subject: Req #63538 [NEW]: "Call to undefined function" should be catchable
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-174758@lists.php.net to get a copy of this message
From: indeyets Operating system: any PHP version: 5.5.0alpha1 Package: Scripting Engine problem Bug Type: Feature/Change Request Bug description:"Call to undefined function" should be catchable Description: ------------ At the moment, call to undefined function results as "Fatal error". On the other hand, it can be easily handled programmatically either by including required file or just defining function dynamically. Test script: --------------- <?php set_error_handler(function($errno , $errstr){ if (strpos($errstr, 'Call to undefined function there_is_no_me()') === 0) { function there_is_no_me() { echo "Here am I!\n"; } } }); there_is_no_me(); Expected result: ---------------- Here am I! Actual result: -------------- Fatal error: Call to undefined function there_is_no_me() -- Edit bug report at https://bugs.php.net/bug.php?id=63538&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63538&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63538&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63538&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63538&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63538&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63538&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63538&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63538&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=63538&r=support Expected behavior: https://bugs.php.net/fix.php?id=63538&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63538&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63538&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63538&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63538&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63538&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63538&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=63538&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63538&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63538&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63538&r=mysqlcfg

« previous php.bugs (#174758) next »