3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public $bar = +array(1, 2, 3); } $f = new foo; var_dump($f->bar);
Output for 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: Unsupported operand types: int + array in /in/X4BMW:4 Stack trace: #0 /in/X4BMW(7): [constant expression]() #1 {main} thrown in /in/X4BMW on line 4
Process exited with code 255.
Output for 8.1.23 - 8.1.28, 8.2.10 - 8.2.18
Fatal error: Uncaught TypeError: Unsupported operand types: int + array in /in/X4BMW:7 Stack trace: #0 {main} thrown in /in/X4BMW on line 7
Process exited with code 255.
Output for 5.3.0 - 5.3.27, 5.4.0 - 5.4.17
Fatal error: Unsupported operand types in /in/KpkgF on line 4
Process exited with code 255.

preferences:
85.11 ms | 402 KiB | 74 Q