php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #63012 register_shutdown_function is not called after error in __toString
Submitted: 2012-09-04 17:55 UTC Modified: 2012-09-05 03:06 UTC
From: david at grudl dot com Assigned:
Status: Duplicate Package: Scripting Engine problem
PHP Version: Irrelevant OS:
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 this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: david at grudl dot com
New email:
PHP Version: OS:

 

 [2012-09-04 17:55 UTC] david at grudl dot com
Description:
------------
Functions registered using register_shutdown_function are called after all fatal errors, except error "Method __toString() must not throw an exception". 

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

class Test
{
	function __toString()
	{
		throw new Exception;
	}
}



register_shutdown_function(function(){
	echo 'Hello';
});

echo new Test;


Expected result:
----------------
writes 'Hello'

Actual result:
--------------
shutdown function is not called

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2012-09-05 03:04 UTC] laruence@php.net
it's a compile error, not a runtime error.

so,, it's expected behavior
 [2012-09-05 03:06 UTC] laruence@php.net
-Status: Open +Status: Duplicate
 [2012-09-05 03:06 UTC] laruence@php.net
oh, sorry, I was wrong, this is similar as #61767, 

see https://bugs.php.net/bug.php?id=61767

thanks
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 08:01:30 2024 UTC