mirror of
https://github.com/php/php-src.git
synced 2024-10-19 15:34:25 +00:00
16 lines
369 B
PHP
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
|