3v4l.org

run code in 300+ PHP versions simultaneously
<?php class User { public function getPassword(): ?string { return NULL; } } class SubUser extends User { public function getPassword() { return NULL; } }
Output for 8.0.1 - 8.0.28, 8.1.0 - 8.1.16, 8.2.0 - 8.2.3
Fatal error: Declaration of SubUser::getPassword() must be compatible with User::getPassword(): ?string in /in/E3qE3 on line 10
Process exited with code 255.

preferences:
157.32 ms | 951 KiB | 7 Q