Bug #64135 [Opn]: Exceptions from set_error_handler are not always propagated
Edit report at https://bugs.php.net/bug.php?id=64135&edit=1
ID: 64135
Updated by: laruence@php.net
Reported by: za_creature at yahoo dot com
Summary: Exceptions from set_error_handler are not always
propagated
Status: Open
Type: Bug
Package: Scripting Engine problem
Operating System: WOW64, CentOS6.3
PHP Version: 5.4.11
-Assigned To:
+Assigned To: dmitry
Block user comment: N
Private report: N
New Comment:
patch attached, but I think maybe only going into PHP 5.5, this could be
considered a BC break.
what do you think, dmitry? thanks
Previous Comments:
------------------------------------------------------------------------
[2013-02-04 06:56:12] laruence@php.net
The following patch has been added/updated:
Patch Name: bug64135.patch
Revision: 1359960972
URL: https://bugs.php.net/patch-display.php?bug=64135&patch=bug64135.patch&revision=1359960972
------------------------------------------------------------------------
[2013-02-02 16:55:11] za_creature at yahoo dot com
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 this bug report at https://bugs.php.net/bug.php?id=64135&edit=1
Thread (6 messages)