3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Test { function hello(int $test) { var_dump($test); } } $test = new Test; $test->hello('test');
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
Fatal error: Uncaught TypeError: Test::hello(): Argument #1 ($test) must be of type int, string given, called in /in/kBJE8 on line 12 and defined in /in/kBJE8:5 Stack trace: #0 /in/kBJE8(12): Test->hello('test') #1 {main} thrown in /in/kBJE8 on line 5
Process exited with code 255.
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.33
Fatal error: Uncaught TypeError: Argument 1 passed to Test::hello() must be of the type int, string given, called in /in/kBJE8 on line 12 and defined in /in/kBJE8:5 Stack trace: #0 /in/kBJE8(12): Test->hello('test') #1 {main} thrown in /in/kBJE8 on line 5
Process exited with code 255.
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33
Fatal error: Uncaught TypeError: Argument 1 passed to Test::hello() must be of the type integer, string given, called in /in/kBJE8 on line 12 and defined in /in/kBJE8:5 Stack trace: #0 /in/kBJE8(12): Test->hello('test') #1 {main} thrown in /in/kBJE8 on line 5
Process exited with code 255.

preferences:
183.7 ms | 402 KiB | 204 Q