3v4l.org

run code in 300+ PHP versions simultaneously
<?php function fooA(): true {} function fooB(): false {} function fooC(): null {} function fooD(): true|null {} function fooE(): false|null {} //function fooF(): false|true {} // Fatal error: Type contains both true and false, bool should be used instead function fooG(): ?true {} function fooH(): ?false {} //function fooI(): ?null {} // Fatal error: null cannot be marked as nullable
Output for 8.2.0 - 8.2.29, 8.3.5 - 8.3.25, 8.4.1 - 8.4.12
Output for 8.0.1 - 8.0.27, 8.1.0 - 8.1.33
Fatal error: Cannot use 'true' as class name as it is reserved in /in/ZpfID on line 3
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Parse error: syntax error, unexpected '|', expecting '{' in /in/ZpfID on line 7
Process exited with code 255.

preferences:
65.22 ms | 408 KiB | 5 Q