blob: 1ee44785b3ce09af32ff9c23d812aea70766198b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
--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
|