]> granicus.if.org Git - php/commitdiff
Test for bug #38146 (Cannot use array returned from foo::__get('bar') in write context)
authorDmitry Stogov <dmitry@php.net>
Mon, 24 Jul 2006 07:43:49 +0000 (07:43 +0000)
committerDmitry Stogov <dmitry@php.net>
Mon, 24 Jul 2006 07:43:49 +0000 (07:43 +0000)
NEWS
Zend/tests/bug38146.phpt [new file with mode: 0755]

diff --git a/NEWS b/NEWS
index 37491351e41223195ecd3c95dda3985e0a8f2d1c..e9ccf33b1fc96879086f26b9adf67c347653892d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,8 @@ PHP                                                                        NEWS
 - Fixed handling of extremely long paths inside tempnam() function. (Ilia)
 - Fixed bug #38183 (disable_classes=Foobar causes disabled class to be
   called Foo). (Jani)
+- Fixed bug #38146 (Cannot use array returned from foo::__get('bar') in write
+  context). (Dmitry)
 - Fixed bug #38125 (undefined reference to spl_dual_it_free_storage). (Marcus)
 - Fixed bug #38086 (stream_copy_to_stream() returns 0 when maxlen is bigger 
   than the actual length). (Tony)
diff --git a/Zend/tests/bug38146.phpt b/Zend/tests/bug38146.phpt
new file mode 100755 (executable)
index 0000000..e321e11
--- /dev/null
@@ -0,0 +1,19 @@
+--TEST--
+Bug #38146 (Cannot use array returned from foo::__get('bar') in write context)
+--FILE--
+<?php
+class foo {
+    public function __get($member) {
+        $f = array("foo"=>"bar","bar"=>"foo");
+        return $f;
+    }
+}
+
+$f = new foo();
+foreach($f->bar as $key => $value) {
+    print "$key => $value\n";
+}
+?>
+--EXPECT--
+foo => bar
+bar => foo