xref: /PHP-8.0/Zend/tests/bug38146.phpt (revision 610c7fbe)
1--TEST--
2Bug #38146 (Cannot use array returned from foo::__get('bar') in write context)
3--FILE--
4<?php
5class foo {
6    public function __get($member) {
7        $f = array("foo"=>"bar","bar"=>"foo");
8        return $f;
9    }
10}
11
12$f = new foo();
13foreach($f->bar as $key => $value) {
14    print "$key => $value\n";
15}
16?>
17--EXPECT--
18foo => bar
19bar => foo
20