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 laruence@php.net)

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-02-04 06:56 UTC] 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-04 07:00 UTC] laruence@php.net
-Assigned To: +Assigned To: dmitry
 [2013-02-04 07:00 UTC] laruence@php.net
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] dmitry@php.net
I don't see any problems with the patch.
 [2013-02-07 14:26 UTC] laruence@php.net
okey, I will commit it to 5.5 and above
 [2013-02-07 15:45 UTC] laruence@php.net
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] laruence@php.net
-Status: Assigned +Status: Closed
 [2013-02-07 15:48 UTC] laruence@php.net
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] laruence@php.net
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: Fri Jan 31 15:01:30 2025 UTC