3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); function login(string $login, #[SensitiveParameter]string $pass): bool { return true; } login("test", 123456);
Output for 8.2rc1 - rc3
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.26, 8.1.0 - 8.1.13
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:
18.19 ms | 412 KiB | 5 Q