|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2016-11-07 07:43 UTC] saschaprolic at googlemail dot com
Description: ------------ PHP freezes when I use the append iterator. I could not create an isolated script, where only this problem is covered, yet. But here is how to reproduce and how to bypass it, take a look at the following change in my PR to prooph/event-store: https://github.com/prooph/event-store/pull/210 I hope this helps you guys already to isolate the problem. Either way, you can always clone our repository and run the tests with that patch excluded, so you will see the same in real action. PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 22:00:01 2025 UTC |
Here is the shortest script to reproduce the issue. <?php $iterator1 = new \AppendIterator(); $iterator2 = new \AppendIterator(); $events = new \ArrayIterator(['event']); $iterator1->append($events); $iterator2->append($events); // without this foreach, i will not hang foreach ($iterator2 as $event) { } $events = new \ArrayIterator(['event']); $iterator1->append($events); $iterator2->append($events);This bug is also there in PHP 5.6 and 7.0! See also this test-script: <?php $iterator1 = new \AppendIterator(); $iterator2 = new \AppendIterator(); $events = new \ArrayIterator(['event']); $iterator1->append($events); $iterator2->append($events); // without this foreach, i will not hang foreach ($iterator2 as $event) { } $iterator1->append(new \ArrayIterator());