From:             za_creature at yahoo dot com
Operating system: WOW64, CentOS6.3
PHP version:      5.4.11
Package:          Scripting Engine problem
Bug Type:         Bug
Bug description:Exceptions from set_error_handler are not always propagated

Description:
------------
echo $undefined works
$undefined++ works
$undefined->method() doesn't


Test script:
---------------
<?php

function exception_error_handler() {
        throw new Exception();
}

set_error_handler("exception_error_handler");
try {
        $undefined->method();
}
catch(Exception $e) {
        echo "Exception is thrown";
}


Expected result:
----------------
Exception is thrown

Actual result:
--------------
PHP Warning:  Uncaught exception 'Exception' in /home/radu/bug.php:4
Stack trace:
#0 /home/radu/bug.php(9): exception_error_handler(8, 'Undefined varia...',

'/home/radu/bug....', 9, Array)
#1 {main}
  thrown in /home/radu/bug.php on line 4

Warning: Uncaught exception 'Exception' in /home/radu/bug.php:4
Stack trace:
#0 /home/radu/bug.php(9): exception_error_handler(8, 'Undefined varia...',

'/home/radu/bug....', 9, Array)
#1 {main}
  thrown in /home/radu/bug.php on line 4
PHP Fatal error:  Call to a member function method() on a non-object in 
/home/radu/bug.php on line 9

-- 
Edit bug report at https://bugs.php.net/bug.php?id=64135&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64135&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64135&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64135&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64135&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64135&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64135&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64135&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64135&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64135&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64135&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64135&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64135&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64135&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64135&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64135&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64135&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64135&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64135&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64135&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64135&r=mysqlcfg

Reply via email to