3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C { const A = 10; const B = 20 + self::A + array(); } var_dump(C::B);
Output for 8.3.0 - 8.3.4
Fatal error: Uncaught TypeError: Unsupported operand types: int + array in /in/uDdgF:5 Stack trace: #0 /in/uDdgF(8): [constant expression]() #1 {main} thrown in /in/uDdgF on line 5
Process exited with code 255.
Output for 8.1.23 - 8.1.27, 8.2.10 - 8.2.17
Fatal error: Uncaught TypeError: Unsupported operand types: int + array in /in/uDdgF:8 Stack trace: #0 {main} thrown in /in/uDdgF on line 8
Process exited with code 255.
Output for 5.3.0 - 5.3.28, 5.4.0 - 5.4.31
Parse error: syntax error, unexpected '+', expecting ',' or ';' in /in/uDdgF on line 5
Process exited with code 255.

preferences:
105.65 ms | 401 KiB | 84 Q