3v4l.org

run code in 300+ PHP versions simultaneously
<?php function wow(int $param){ return ++$param; } echo wow(1).PHP_EOL; echo wow(3.11).PHP_EOL; echo wow('4abc').PHP_EOL; echo wow('5.1').PHP_EOL;
Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
2 Deprecated: Implicit conversion from float 3.11 to int loses precision in /in/IEbRE on line 3 4 Fatal error: Uncaught TypeError: wow(): Argument #1 ($param) must be of type int, string given, called in /in/IEbRE on line 9 and defined in /in/IEbRE:3 Stack trace: #0 /in/IEbRE(9): wow('4abc') #1 {main} thrown in /in/IEbRE on line 3
Process exited with code 255.
Output for 8.0.0 - 8.0.30
2 4 Fatal error: Uncaught TypeError: wow(): Argument #1 ($param) must be of type int, string given, called in /in/IEbRE on line 9 and defined in /in/IEbRE:3 Stack trace: #0 /in/IEbRE(9): wow('4abc') #1 {main} thrown in /in/IEbRE on line 3
Process exited with code 255.
Output for 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.31, 7.4.0 - 7.4.33
2 4 Notice: A non well formed numeric value encountered in /in/IEbRE on line 3 5 6
Output for 7.3.32 - 7.3.33
2 4 5 6
Output for 5.6.0 - 5.6.38
Catchable fatal error: Argument 1 passed to wow() must be an instance of int, integer given, called in /in/IEbRE on line 7 and defined in /in/IEbRE on line 3
Process exited with code 255.

preferences:
176.63 ms | 411 KiB | 5 Q