xref: /PHP-8.3/Zend/tests/ns_087.phpt (revision 7aacc705)
1--TEST--
2087: bracketed namespace with stuff in between
3--FILE--
4<?php
5namespace foo {
6use \foo;
7class bar {
8    function __construct() {echo __METHOD__,"\n";}
9}
10new foo;
11new bar;
12}
13$a = 'oops';
14namespace {
15class foo {
16    function __construct() {echo __METHOD__,"\n";}
17}
18use foo\bar as foo1;
19new foo1;
20new foo;
21echo "===DONE===\n";
22}
23?>
24--EXPECTF--
25Fatal error: No code may exist outside of namespace {} in %s on line 10
26