php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #64135 Exceptions from set_error_handler are not always propagated
Submitted: 2013-02-02 16:55 UTC Modified: 2013-02-07 14:26 UTC
From: za_creature at yahoo dot com Assigned: dmitry (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.4.11 OS: WOW64, CentOS6.3
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: za_creature at yahoo dot com
New email:
PHP Version: OS:

 

 [2013-02-02 16:55 UTC] 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

Patches

bug64135.patch (last revision 2013-02-04 06:56 UTC by [email protected])

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-04 06:56 UTC] [email protected]
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-04 07:00 UTC] [email protected]
-Assigned To: +Assigned To: dmitry
 [2013-02-04 07:00 UTC] [email protected]
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
 [2013-02-04 08:12 UTC] [email protected]
I don't see any problems with the patch.
 [2013-02-07 14:26 UTC] [email protected]
okey, I will commit it to 5.5 and above
 [2013-02-07 15:45 UTC] [email protected]
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=290509755ac4a3279b2b31b899aa9f2dd780f5f4
Log: Fixed bug #64135 (Exceptions from set_error_handler are not always propagated)
 [2013-02-07 15:45 UTC] [email protected]
-Status: Assigned +Status: Closed
 [2013-02-07 15:48 UTC] [email protected]
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=290509755ac4a3279b2b31b899aa9f2dd780f5f4
Log: Fixed bug #64135 (Exceptions from set_error_handler are not always propagated)
 [2013-11-17 09:31 UTC] [email protected]
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=290509755ac4a3279b2b31b899aa9f2dd780f5f4
Log: Fixed bug #64135 (Exceptions from set_error_handler are not always propagated)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Dec 31 04:00:01 2025 UTC