3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); function login(string $login, #[SensitiveParameter]string $pass): bool { return true; } login("test", 123456);
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.13, 8.6.0
Fatal error: Uncaught TypeError: login(): Argument #2 ($pass) must be of type string, int given, called in /in/kJKvH on line 10 and defined in /in/kJKvH:5 Stack trace: #0 /in/kJKvH(10): login('test', Object(SensitiveParameterValue)) #1 {main} thrown in /in/kJKvH on line 5
Process exited with code 255.
Output for 8.0.1 - 8.0.30, 8.1.0 - 8.1.34
Fatal error: Uncaught TypeError: login(): Argument #2 ($pass) must be of type string, int given, called in /in/kJKvH on line 10 and defined in /in/kJKvH:5 Stack trace: #0 /in/kJKvH(10): login('test', 123456) #1 {main} thrown in /in/kJKvH on line 5
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Parse error: syntax error, unexpected '{', expecting variable (T_VARIABLE) in /in/kJKvH on line 6
Process exited with code 255.

preferences:
48.34 ms | 1170 KiB | 6 Q