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.34, 8.3.0 - 8.3.35, 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:
26.68 ms | 1151 KiB | 6 Q