3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class wpq { private $unreferenced; public function __get($name) { return $this->$name . "XXX"; } } function ret_assoc() { $x = "XXX"; return array('foo' => 'bar', $x); } $wpq = new wpq; $wpq->interesting =& ret_assoc(); $x = $wpq->interesting; printf("%s\n", $x);
Output for 7.0.0 - 7.2.0
Notice: Undefined property: wpq::$interesting in /in/8E8FF on line 7 Notice: Indirect modification of overloaded property wpq::$interesting has no effect in /in/8E8FF on line 17 Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in /in/8E8FF:17 Stack trace: #0 {main} thrown in /in/8E8FF on line 17
Process exited with code 255.
Output for 5.6.12 - 5.6.28
Notice: Undefined property: wpq::$interesting in /in/8E8FF on line 7 Notice: Indirect modification of overloaded property wpq::$interesting has no effect in /in/8E8FF on line 17 Fatal error: Cannot assign by reference to overloaded object in /in/8E8FF on line 17
Process exited with code 255.
Output for 5.3.19 - 5.3.29, 5.5.27 - 5.5.35, 5.6.11
Notice: Undefined property: wpq::$interesting in /in/8E8FF on line 7 Notice: Indirect modification of overloaded property wpq::$interesting has no effect in /in/8E8FF on line 17 Strict Standards: Only variables should be assigned by reference in /in/8E8FF on line 17 Notice: Undefined property: wpq::$interesting in /in/8E8FF on line 7 XXX
Output for 5.4.0 - 5.4.9, 5.5.24 - 5.5.26, 5.6.8 - 5.6.10
Notice: Undefined property: wpq::$interesting in /in/8E8FF on line 7 Notice: Indirect modification of overloaded property wpq::$interesting has no effect in /in/8E8FF on line 17 Strict Standards: Only variables should be assigned by reference in /in/8E8FF on line 17 Notice: Undefined property: wpq::$interesting in /in/8E8FF on line 7
Process exited with code 139.
Output for 5.4.10 - 5.4.45
Notice: Undefined property: wpq::$interesting in /in/8E8FF on line 7 Notice: Indirect modification of overloaded property wpq::$interesting has no effect in /in/8E8FF on line 17 Strict Standards: Only variables should be assigned by reference in /in/8E8FF on line 17
Process exited with code 139.