|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52627 Iterators & trigger_error causes crash
Submitted: 2010-08-17 18:11 UTC Modified: 2010-08-17 18:36 UTC
From: david at grudl dot com Assigned:
Status: Closed Package: Reproducible crash
PHP Version: 5.3.3 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: david at grudl dot com
New email:
PHP Version: OS:


 [2010-08-17 18:11 UTC] david at grudl dot com
Throwing any error in foreach causes PHP to crash since PHP 5.1.3

Test script:
class MyFilterIterator extends FilterIterator
	function accept() { return TRUE; }

$iterator = new RecursiveArrayIterator(array(1));
$iterator = new RecursiveIteratorIterator($iterator);
$iterator = new MyFilterIterator($iterator);

foreach ($iterator as $component) {
	trigger_error('User error', E_USER_ERROR); 
        // or trigger fatal error by calling undefined function xyz()


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-08-17 18:16 UTC]
-Status: Open +Status: Feedback
 [2010-08-17 18:16 UTC]
Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read for *NIX and for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.

I can't reproduce this on OS X or Linux. Besides needing a backtrace,
we'll also need to know what operating system you're running.
 [2010-08-17 18:36 UTC] david at grudl dot com
-Status: Feedback +Status: Open
 [2010-08-17 18:36 UTC] david at grudl dot com
I am sorry, this bug affects only 5.1.3 - 5.3.2 and is fixed in 5.3.3.
 [2010-08-17 18:36 UTC] david at grudl dot com
-Status: Open +Status: Closed
 [2010-08-17 18:36 UTC] david at grudl dot com
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Feb 23 15:01:34 2024 UTC