3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php class wpq { private $unreferenced; public function __get($name) { return $this->$name; } } function ret_assoc() { return array('foo' => 'bar'); } $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/3pVQT on line 7 Notice: Indirect modification of overloaded property wpq::$interesting has no effect in /in/3pVQT on line 16 Fatal error: Uncaught Error: Cannot assign by reference to overloaded object in /in/3pVQT:16 Stack trace: #0 {main} thrown in /in/3pVQT on line 16
Process exited with code 255.
Output for 5.6.12 - 5.6.28
Notice: Undefined property: wpq::$interesting in /in/3pVQT on line 7 Notice: Indirect modification of overloaded property wpq::$interesting has no effect in /in/3pVQT on line 16 Fatal error: Cannot assign by reference to overloaded object in /in/3pVQT on line 16
Process exited with code 255.
Output for 5.3.21 - 5.3.29, 5.5.27 - 5.5.38, 5.6.11
Notice: Undefined property: wpq::$interesting in /in/3pVQT on line 7 Notice: Indirect modification of overloaded property wpq::$interesting has no effect in /in/3pVQT on line 16 Strict Standards: Only variables should be assigned by reference in /in/3pVQT on line 16 Notice: Undefined property: wpq::$interesting in /in/3pVQT on line 7
Output for 5.4.11 - 5.5.26, 5.6.8 - 5.6.10
Notice: Undefined property: wpq::$interesting in /in/3pVQT on line 7 Notice: Indirect modification of overloaded property wpq::$interesting has no effect in /in/3pVQT on line 16 Strict Standards: Only variables should be assigned by reference in /in/3pVQT on line 16 Notice: Undefined property: wpq::$interesting in /in/3pVQT on line 7
Process exited with code 139.