summaryrefslogtreecommitdiff
path: root/Zend/tests/bug71266.phpt
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2016-06-07 23:18:52 +0300
committerDmitry Stogov <dmitry@zend.com>2016-06-07 23:18:52 +0300
commit421843977f3f2f65c2e7d6d2827b322a54042422 (patch)
tree3ef811de0fd898ae3af17eecade75e4c9a6b30f8 /Zend/tests/bug71266.phpt
parentbe37de1ff153c4ac51d14177572aa332612ae8e1 (diff)
downloadphp-git-421843977f3f2f65c2e7d6d2827b322a54042422.tar.gz
Fixed bug #71266 (Missing separation of properties HT in foreach etc).
Diffstat (limited to 'Zend/tests/bug71266.phpt')
-rw-r--r--Zend/tests/bug71266.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/Zend/tests/bug71266.phpt b/Zend/tests/bug71266.phpt
new file mode 100644
index 0000000000..d67c6f6363
--- /dev/null
+++ b/Zend/tests/bug71266.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #71266 (Missing separation of properties HT in foreach etc)
+--FILE--
+<?php
+$one = 1;
+$two = 2;
+$arr = ['foo' => $one, 'bar' => $two];
+$obj = (object) $arr;
+foreach ($obj as $val) {
+ var_dump($val);
+ $obj->bar = 42;
+}
+
+$arr = ['foo' => $one, 'bar' => $two];
+$obj = (object) $arr;
+next($obj);
+var_dump(current($arr));
+?>
+--EXPECT--
+int(1)
+int(42)
+int(1)