|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
Patchesbug63917.phpt (last revision 2013-01-09 15:18 UTC by ashnazg@php.net)Pull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-01-08 21:05 UTC] ashnazg@php.net
[2013-01-09 06:05 UTC] LastDragon at yandex dot ru
[2013-01-09 15:18 UTC] ashnazg@php.net
[2013-09-21 22:58 UTC] levim@php.net
-Status: Open
+Status: Duplicate
[2013-09-21 22:58 UTC] levim@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 07:00:02 2025 UTC |
Description: ------------ Iteration of all the objects is not possible after the detach method was called. Test script: --------------- <?php $s = new SplObjectStorage(); $s->attach(new StdClass); $s->attach(new StdClass); $s->attach(new StdClass); $s->attach(new StdClass); var_dump($s->count()); foreach ($s as $v) { var_dump($v); $s->detach($v); } var_dump($s->count()); Expected result: ---------------- int(4) object(stdClass)#2 (0) { } object(stdClass)#4 (0) { } object(stdClass)#5 (0) { } int(1) Actual result: -------------- int(4) object(stdClass)#2 (0) { } object(stdClass)#3 (0) { } object(stdClass)#4 (0) { } object(stdClass)#5 (0) { } int(0)