|  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
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
49 - 22 = ?
Subscribe to this entry?

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

Test script:

class Test
	function __toString()
		throw new Exception;

	echo 'Hello';

echo new Test;

Expected result:
writes 'Hello'

Actual result:
shutdown function is not called


Add a Patch

Pull Requests

Add a Pull Request


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

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


PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Dec 04 09:03:37 2021 UTC