mirror of
https://github.com/php/php-src.git
synced 2024-09-23 10:57:26 +00:00
4ab097eba1
The issue itself is not fixed, this is just a workaround.
21 lines
487 B
PHP
21 lines
487 B
PHP
--TEST--
|
|
Bug #55157: ArrayIterator always skips the second element in the array when calling offsetUnset()
|
|
--DESCRIPTION--
|
|
One of the test cases from bug #55157. This is a workaround around the problem that has worked
|
|
since PHP 5.0.4.
|
|
--FILE--
|
|
<?php
|
|
$nums = range(0, 3);
|
|
$numIt = new ArrayIterator($nums);
|
|
|
|
for ($numIt->rewind(); $numIt->valid();) {
|
|
echo "{$numIt->key()} => {$numIt->current()}\n";
|
|
$numIt->offsetUnset($numIt->key());
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
0 => 0
|
|
1 => 1
|
|
2 => 2
|
|
3 => 3
|