bug75420.5.phpt 365 B

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