Patch bug63917.phpt for SPL related Bug #63917
Patch version 2013-01-09 15:18 UTC
Return to Bug #63917 |
Download this patch
Patch Revisions:
Developer: ashnazg@php.net
--TEST--
Show that calling SplObjectStorage::detach() inside a foreach() does not disrupt proper Iterating
--CREDITS--
lastdragon@yandex.ru (bug reporter)
ashnazg@php.net (phpt)
--FILE--
<?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());
?>
--EXPECT--
int(4)
object(stdClass)#2 (0) {
}
object(stdClass)#3 (0) {
}
object(stdClass)#4 (0) {
}
object(stdClass)#5 (0) {
}
int(0)
|