3v4l.org

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