Closed john-n-smith closed 10 years ago
It seems to try to set the internal pointer to 1
1
$spl = new SplObjectStorage(); $n = 4; for($i=0; $i < $n; $i++) { $object = new StdClass; $spl->attach($object); } foreach($spl as $object) { echo $spl->key() . '<br>'; $spl->detach($object); }
results in
0 1 1
n = 3:
n = 3
0 1
n = 2:
n = 2
0
Good bug finding!
It seems to try to set the internal pointer to
1
results in
n = 3
:n = 2
: