xref: /PHP-8.1/Zend/tests/ns_041.phpt (revision 7aacc705)
1--TEST--
2041: Constants in namespace
3--FILE--
4<?php
5namespace test\ns1;
6
7const FOO = "ok\n";
8
9echo(FOO);
10echo(\test\ns1\FOO);
11echo(\test\ns1\FOO);
12echo(BAR);
13
14const BAR = "ok\n";
15?>
16--EXPECTF--
17ok
18ok
19ok
20
21Fatal error: Uncaught Error: Undefined constant "test\ns1\BAR" in %s:%d
22Stack trace:
23#0 {main}
24  thrown in %s on line %d
25