3v4l.org

run code in 300+ PHP versions simultaneously
<?php function takesInt(int $val): int { return $val + 1; } takesInt("not int");
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.29, 8.2.0 - 8.2.23, 8.3.0 - 8.3.11
Fatal error: Uncaught TypeError: takesInt(): Argument #1 ($val) must be of type int, string given, called in /in/ib9KV on line 7 and defined in /in/ib9KV:3 Stack trace: #0 /in/ib9KV(7): takesInt('not int') #1 {main} thrown in /in/ib9KV on line 3
Process exited with code 255.

preferences:
62.98 ms | 406 KiB | 5 Q