3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(int $a) { echo "$a\n"; } test(3.5);
Output for 8.1.0 - 8.1.28, 8.2.0 - 8.2.19, 8.3.0 - 8.3.7
Deprecated: Implicit conversion from float 3.5 to int loses precision in /in/E084N on line 2 3
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30
3
Output for 5.4.8 - 5.4.45, 5.5.24 - 5.5.35, 5.6.8 - 5.6.28
Catchable fatal error: Argument 1 passed to test() must be an instance of int, double given, called in /in/E084N on line 3 and defined in /in/E084N on line 2
Process exited with code 255.

preferences:
146.86 ms | 402 KiB | 222 Q