xref: /PHP-8.2/Zend/tests/bug46304.phpt (revision d30cd7d7)
1--TEST--
2Bug #46304 (defining namespaced constant using define())
3--FILE--
4<?php
5
6define('NS1\ns2\const1','value1');
7define('ns1\ns2\const2','value2');
8define('ns1\NS2\coNSt3','value3');
9
10print NS1\ns2\const1 . "\n";
11print ns1\ns2\const1 . "\n";
12print ns1\NS2\const1 . "\n";
13
14print NS1\ns2\const2 . "\n";
15print ns1\ns2\const2 . "\n";
16print ns1\NS2\const2 . "\n";
17
18print NS1\ns2\coNSt3 . "\n";
19print ns1\ns2\coNSt3 . "\n";
20print ns1\ns2\coNSt3 . "\n";
21
22print NS1\ns2\coNSt1 . "\n";
23?>
24--EXPECTF--
25value1
26value1
27value1
28value2
29value2
30value2
31value3
32value3
33value3
34
35Fatal error: Uncaught Error: Undefined constant "NS1\ns2\coNSt1" in %s:%d
36Stack trace:
37#0 {main}
38  thrown in %sbug46304.php on line %d
39