1
0
mirror of https://github.com/php/php-src.git synced 2026-03-27 17:52:16 +01:00
Files
archived-php-src/ext/spl/tests/DirectoryIterator_by_reference.phpt
2009-08-26 17:17:58 +00:00

14 lines
359 B
PHP

--TEST--
DirectoryIterator: test that you cannot use iterator with reference
--CREDITS--
Havard Eide <nucleuz@gmail.com>
#PHPTestFest2009 Norway 2009-06-09 \o/
--FILE--
<?php
$it = new DirectoryIterator("/tmp");
foreach( $it as &$file ) {
echo $file . "\n";
}
?>
--EXPECTF--
Fatal error: An iterator cannot be used with foreach by reference in %s on line %d