3v4l.org

run code in 500+ 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.31, 8.3.5 - 8.3.31, 8.4.1 - 8.4.22, 8.5.0 - 8.5.7
Output for 8.0.1 - 8.0.27, 8.1.0 - 8.1.34
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:
58.91 ms | 1065 KiB | 4 Q