xref: /PHP-7.3/Zend/tests/ns_087.phpt (revision ea45b713)
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--EXPECTF--
24Fatal error: No code may exist outside of namespace {} in %s on line 10
25