bug38146.phpt 348 B

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