php-src/Zend/tests/bug38146.phpt
2012-10-10 10:27:49 +08:00

20 lines
348 B
PHP

--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