3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test1(): X|Y|int|float|false|null { } var_dump((new ReflectionFunction('test1'))->getReturnType()->allowsNull());
Output for 8.0.0 - 8.0.13, 8.1rc1 - rc3
bool(true)
Output for 7.3.0 - 7.3.33, 7.4.0 - 7.4.26
Parse error: syntax error, unexpected '|', expecting '{' in /in/P9U4u on line 3
Process exited with code 255.

preferences:
36.63 ms | 460 KiB | 5 Q