]> granicus.if.org Git - php/commitdiff
Add new test (from pierre)
authorMarcus Boerger <helly@php.net>
Thu, 26 Feb 2004 19:51:08 +0000 (19:51 +0000)
committerMarcus Boerger <helly@php.net>
Thu, 26 Feb 2004 19:51:08 +0000 (19:51 +0000)
tests/lang/foreach_with_object_001.phpt [new file with mode: 0755]

diff --git a/tests/lang/foreach_with_object_001.phpt b/tests/lang/foreach_with_object_001.phpt
new file mode 100755 (executable)
index 0000000..598b844
--- /dev/null
@@ -0,0 +1,25 @@
+--TEST--
+foreach() with foreach($o->mthd()->arr)
+--FILE--
+<?php
+class Test {
+   public $a = array(1,2,3,4,5); // removed, crash too
+   function c() {
+      return new Test();
+   }
+
+}
+$obj = new Test();
+foreach ($obj->c()->a as $value) {
+    print "$value\n";
+}
+
+?>
+===DONE===
+--EXPECT--
+1
+2
+3
+4
+5
+===DONE===