summaryrefslogtreecommitdiff
path: root/tests/lang/foreach_with_object_001.phpt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lang/foreach_with_object_001.phpt')
-rw-r--r--tests/lang/foreach_with_object_001.phpt25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/lang/foreach_with_object_001.phpt b/tests/lang/foreach_with_object_001.phpt
new file mode 100644
index 0000000..598b844
--- /dev/null
+++ b/tests/lang/foreach_with_object_001.phpt
@@ -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===