3v4l.org

run code in 500+ PHP versions simultaneously
<?php // Not allowed namespace namespace {} //syntax error, unexpected namespace-relative name "namespace\A", expecting "{" namespace namespace\A {} // namespace may be used, but not in first position // surely, not a good idea namespace A\namespace { const B = 1; } namespace A { echo namespace\namespace\B; } ?>
Output for 8.2.0 - 8.2.28, 8.3.0 - 8.3.19, 8.4.1 - 8.4.5
Parse error: syntax error, unexpected namespace-relative name "namespace\A", expecting "{" in /in/gQie5 on line 7
Process exited with code 255.

preferences:
42.31 ms | 712 KiB | 3 Q