summaryrefslogtreecommitdiff
path: root/ext/spl/tests/DirectoryIterator_by_reference.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'ext/spl/tests/DirectoryIterator_by_reference.phpt')
-rw-r--r--ext/spl/tests/DirectoryIterator_by_reference.phpt14
1 files changed, 14 insertions, 0 deletions
diff --git a/ext/spl/tests/DirectoryIterator_by_reference.phpt b/ext/spl/tests/DirectoryIterator_by_reference.phpt
new file mode 100644
index 0000000..06127ec
--- /dev/null
+++ b/ext/spl/tests/DirectoryIterator_by_reference.phpt
@@ -0,0 +1,14 @@
+--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(__DIR__);
+foreach( $it as &$file ) {
+ echo $file . "\n";
+}
+?>
+--EXPECTF--
+Fatal error: An iterator cannot be used with foreach by reference in %s on line %d