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

Reply via email to