mirror of
https://github.com/php/php-src.git
synced 2026-03-24 08:12:21 +01:00
RFC: https://wiki.php.net/rfc/deprecations_php_8_5#deprecate_arrayobject_and_arrayiterator_with_objects This also moves tests into a subfolder.
37 lines
752 B
PHP
37 lines
752 B
PHP
--TEST--
|
|
SPL: RecursiveIteratorIterator - Test where the case is RS_SELF and mode is CHILD_FIRST
|
|
--FILE--
|
|
<?php
|
|
|
|
$recArrIt = new RecursiveArrayIterator([
|
|
[1, 2],
|
|
['a', 'b'],
|
|
]);
|
|
|
|
class MyRecursiveIteratorIterator extends RecursiveIteratorIterator {
|
|
|
|
function nextelement(): void {
|
|
echo __METHOD__."\n";
|
|
}
|
|
}
|
|
|
|
|
|
$recItIt = new MyRecursiveIteratorIterator($recArrIt, RecursiveIteratorIterator::CHILD_FIRST);
|
|
|
|
foreach ($recItIt as $key => $val) echo "$key\n";
|
|
|
|
?>
|
|
--EXPECT--
|
|
MyRecursiveIteratorIterator::nextelement
|
|
0
|
|
MyRecursiveIteratorIterator::nextelement
|
|
1
|
|
MyRecursiveIteratorIterator::nextelement
|
|
0
|
|
MyRecursiveIteratorIterator::nextelement
|
|
0
|
|
MyRecursiveIteratorIterator::nextelement
|
|
1
|
|
MyRecursiveIteratorIterator::nextelement
|
|
1
|