bug69732.phpt 712 B

12345678910111213141516171819202122232425262728293031
  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. ?>
  20. --EXPECTF--
  21. Warning: Undefined property: wpq::$interesting in %s on line %d
  22. Notice: Indirect modification of overloaded property wpq::$interesting has no effect in %sbug69732.php on line 16
  23. Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in %s:%d
  24. Stack trace:
  25. #0 {main}
  26. thrown in %s on line %d