3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function foo(int $bar) { echo $bar; } foo(1.0);
Output for 8.2.0 - 8.2.29, 8.3.0 - 8.3.25, 8.4.1 - 8.4.12
Fatal error: Uncaught TypeError: foo(): Argument #1 ($bar) must be of type int, float given, called in /in/SuoO9 on line 9 and defined in /in/SuoO9:5 Stack trace: #0 /in/SuoO9(9): foo(1.0) #1 {main} thrown in /in/SuoO9 on line 5
Process exited with code 255.

preferences:
44.72 ms | 406 KiB | 5 Q