mirror of
https://github.com/php/php-src.git
synced 2024-12-04 23:34:25 +08:00
18 lines
434 B
PHP
18 lines
434 B
PHP
--TEST--
|
|
SPL: RecursiveIteratorIterator cannot be used with foreach by reference
|
|
--FILE--
|
|
<?php
|
|
|
|
$arr = array(array(1,2));
|
|
$arrOb = new ArrayObject($arr);
|
|
|
|
$recArrIt = new RecursiveArrayIterator($arrOb->getIterator());
|
|
|
|
$recItIt = new RecursiveIteratorIterator($recArrIt);
|
|
|
|
foreach ($recItIt as &$val) echo "$val\n";
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: An iterator cannot be used with foreach by reference in %s on line %d
|