3v4l.org

run code in 300+ 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:
151.23 ms | 1320 KiB | 6 Q