xref: /PHP-7.0/Zend/tests/ns_076.phpt (revision e97d5fab)
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--
14Notice: Use of undefined constant unknown - assumed 'unknown' in %sns_076.php on line %d
15
16Notice: Use of undefined constant unknown - assumed 'unknown' in %sns_076.php on line %d
17
18Notice: Use of undefined constant unknown - assumed 'unknown' 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