xref: /PHP-8.1/Zend/tests/ns_076.phpt (revision d30cd7d7)
1--TEST--
2076: Unknown constants in namespace
3--FILE--
4<?php
5namespace foo;
6use Error;
7
8try {
9    $a = array(unknown => unknown);
10} catch (Error $e) {
11    echo $e->getMessage(), "\n";
12}
13
14try {
15    echo unknown;
16} catch (Error $e) {
17    echo $e->getMessage(), "\n";
18}
19
20try {
21    echo \unknown;
22} catch (Error $e) {
23    echo $e->getMessage(), "\n";
24}
25
26?>
27--EXPECT--
28Undefined constant "foo\unknown"
29Undefined constant "foo\unknown"
30Undefined constant "unknown"
31