3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo($aaa):?float { return 'aaa'; } var_dump(foo(123));
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.27, 8.2.0 - 8.2.17, 8.3.0 - 8.3.4
Fatal error: Uncaught TypeError: foo(): Return value must be of type ?float, string returned in /in/oG6ij:3 Stack trace: #0 /in/oG6ij(6): foo(123) #1 {main} thrown in /in/oG6ij on line 3
Process exited with code 255.
Output for 7.2.29 - 7.2.33, 7.3.16 - 7.3.33, 7.4.4 - 7.4.33
Fatal error: Uncaught TypeError: Return value of foo() must be of the type float or null, string returned in /in/oG6ij:3 Stack trace: #0 /in/oG6ij(6): foo(123) #1 {main} thrown in /in/oG6ij on line 3
Process exited with code 255.

preferences:
138.92 ms | 402 KiB | 131 Q