bug75420.2.phpt 390 B

12345678910111213141516171819
  1. --TEST--
  2. Bug #75420.2 (Indirect modification of magic method argument)
  3. --FILE--
  4. <?php
  5. class Test {
  6. public function __isset($x) { $GLOBALS["name"] = 24; return true; }
  7. public function __get($x) { var_dump($x); return 42; }
  8. }
  9. $obj = new Test;
  10. $name = "foo";
  11. $name = str_repeat($name, 2);
  12. var_dump($obj->$name ?? 12);
  13. var_dump($name);
  14. ?>
  15. --EXPECT--
  16. string(6) "foofoo"
  17. int(42)
  18. int(24)