3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); function a() : bool { return 1; } a();
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Uncaught TypeError: a(): Return value must be of type bool, int returned in /in/g6ig9:5 Stack trace: #0 /in/g6ig9(7): a() #1 {main} thrown in /in/g6ig9 on line 5
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: Return value of a() must be of the type bool, int returned in /in/g6ig9:5 Stack trace: #0 /in/g6ig9(7): a() #1 {main} thrown in /in/g6ig9 on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33
Fatal error: Uncaught TypeError: Return value of a() must be of the type boolean, integer returned in /in/g6ig9:5 Stack trace: #0 /in/g6ig9(7): a() #1 {main} thrown in /in/g6ig9 on line 5
Process exited with code 255.
Output for 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Warning: Unsupported declare 'strict_types' in /in/g6ig9 on line 2 Parse error: syntax error, unexpected ':', expecting '{' in /in/g6ig9 on line 3
Process exited with code 255.

preferences:
184.64 ms | 402 KiB | 198 Q