xref: /PHP-7.2/Zend/tests/ns_076.phpt (revision 1b565f13)
1--TEST--
2076: Unknown constants in namespace
3--FILE--
4<?php
5namespace foo;
6
7$a = array(unknown => unknown);
8
9echo unknown;
10echo "\n";
11var_dump($a);
12echo \unknown;
13--EXPECTF--
14Warning: Use of undefined constant unknown - assumed 'unknown' (this will throw an Error in a future version of PHP) in %sns_076.php on line %d
15
16Warning: Use of undefined constant unknown - assumed 'unknown' (this will throw an Error in a future version of PHP) in %sns_076.php on line %d
17
18Warning: Use of undefined constant unknown - assumed 'unknown' (this will throw an Error in a future version of PHP) in %sns_076.php on line %d
19unknown
20array(1) {
21  ["unknown"]=>
22  %s(7) "unknown"
23}
24
25Fatal error: Uncaught Error: Undefined constant 'unknown' in %sns_076.php:%d
26Stack trace:
27#0 {main}
28  thrown in %sns_076.php on line %d
29