3v4l.org

run code in 300+ PHP versions simultaneously
<?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 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
Warning: 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 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 Warning: 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 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
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.40
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.5.27 - 5.5.38, 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.0 - 5.5.26, 5.6.0 - 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.

preferences:
279.65 ms | 401 KiB | 384 Q