3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); function test(int $value) { var_dump($value); } test("5"); // TypeError
Output for 8.2.0 - 8.2.36, 8.3.0 - 8.3.37, 8.4.1 - 8.4.28, 8.5.0 - 8.5.12
Fatal error: Uncaught TypeError: test(): Argument #1 ($value) must be of type int, string given, called in /in/gTh8M on line 8 and defined in /in/gTh8M:4 Stack trace: #0 /in/gTh8M(8): test('5') #1 {main} thrown in /in/gTh8M on line 4
Process exited with code 255.

preferences:
37.54 ms | 1164 KiB | 6 Q