php-src/ext/spl/tests/spl_iterator_recursive_getiterator_error.phpt
2009-05-17 15:24:08 +00:00

16 lines
369 B
PHP

--TEST--
SPL: IteratorIterator foreach by reference failure
--CREDITS--
Lukasz Andrzejak meltir@meltir.com
#testfest London 2009-05-09
--FILE--
<?php
$i = new ArrayIterator(array(1,1,1,1,1));
$iii = new IteratorIterator($i);
p($iii);
function p ($i) {
foreach ($i as &$value) {}
}
?>
--EXPECTF--
Fatal error: An iterator cannot be used with foreach by reference in %s