bug69732.phpt 716 B

123456789101112131415161718192021222324252627282930
  1. --TEST--
  2. Bug #69732 (can induce segmentation fault with basic php code)
  3. --FILE--
  4. <?php
  5. class wpq {
  6. private $unreferenced;
  7. public function __get($name) {
  8. return $this->$name . "XXX";
  9. }
  10. }
  11. function ret_assoc() {
  12. $x = "XXX";
  13. return array('foo' => 'bar', $x);
  14. }
  15. $wpq = new wpq;
  16. $wpq->interesting =& ret_assoc();
  17. $x = $wpq->interesting;
  18. printf("%s\n", $x);
  19. --EXPECTF--
  20. Notice: Undefined property: wpq::$interesting in %sbug69732.php on line 6
  21. Notice: Indirect modification of overloaded property wpq::$interesting has no effect in %sbug69732.php on line 16
  22. Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d
  23. Stack trace:
  24. #0 {main}
  25. thrown in %s on line %d