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.
21 lines
424 B
PHP
21 lines
424 B
PHP
--TEST--
|
|
SPL: RecursiveIteratorIterator cannot be used with foreach by reference
|
|
--FILE--
|
|
<?php
|
|
|
|
$recArrIt = new RecursiveArrayIterator([
|
|
[1, 2],
|
|
['a', 'b'],
|
|
]);
|
|
|
|
$recItIt = new RecursiveIteratorIterator($recArrIt);
|
|
|
|
foreach ($recItIt as &$val) echo "$val\n";
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Error: An iterator cannot be used with foreach by reference in %s:%d
|
|
Stack trace:
|
|
#0 {main}
|
|
thrown in %s on line %d
|