From: bugs dot php dot net-V29nHf1_z-nsp at cvogt dot org Operating system: PHP version: 5.2.6 PHP Bug Type: Feature/Change Request Bug description: E_RECOVERABLE_ERROR for "Call to a member function on a non-object"
Description: ------------ Calling a method on a non-object results in a non catchable fatal error, that cannot be handled by an error_handler. It would be great if it would be a catchable fatal error instead. This would e.g. make possible to send an e-mail to the developers in case of such an error. When using object-orientation heavily, a program bug can easily result in an uninitialized or wrongly initialized variable, currently leading to a fatal error. Being able to handle this error case would be a great improvement for quality control. I hope the implementation of PHP allows such a change. This request is similar to http://bugs.php.net/bug.php?id=40587 . In case this request is rejected, please attach a short reason. Reproduce code: --------------- set_error_handler( create_function('$code','echo "error handler called ($code)\n";') ); $o = NULL; $o->method(); echo "end of script\n"; Expected result: ---------------- error handler called (4096) end of script Actual result: -------------- Fatal error: Call to a member function method() on a non-object -- Edit bug report at http://bugs.php.net/?id=46601&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=46601&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=46601&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=46601&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=46601&r=fixedcvs Fixed in CVS and need be documented: http://bugs.php.net/fix.php?id=46601&r=needdocs Fixed in release: http://bugs.php.net/fix.php?id=46601&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=46601&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=46601&r=needscript Try newer version: http://bugs.php.net/fix.php?id=46601&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=46601&r=support Expected behavior: http://bugs.php.net/fix.php?id=46601&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=46601&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=46601&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=46601&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=46601&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=46601&r=dst IIS Stability: http://bugs.php.net/fix.php?id=46601&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=46601&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=46601&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=46601&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=46601&r=mysqlcfg