3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { private $foo = 'bar'; public function __get($name) { return $this->{$name}; } public function __set($name, $value) { $this->{$name} = $value; } } $foo = new Foo(); $bar &= $foo->foo;
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
Warning: Undefined variable $bar in /in/PWVs9 on line 10 Fatal error: Uncaught TypeError: Unsupported operand types: null & string in /in/PWVs9:10 Stack trace: #0 {main} thrown in /in/PWVs9 on line 10
Process exited with code 255.
Output for 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
Notice: Undefined variable: bar in /in/PWVs9 on line 10 Warning: A non-numeric value encountered in /in/PWVs9 on line 10
Output for 7.3.32 - 7.3.33
Warning: A non-numeric value encountered in /in/PWVs9 on line 10

preferences:
129.68 ms | 408 KiB | 5 Q