summaryrefslogtreecommitdiff
path: root/Zend/tests/ns_041.phpt
blob: a77b74eaf5fb9c4b513045d704eeee9817aaa8be (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
--TEST--
041: Constants in namespace
--FILE--
<?php
namespace test\ns1;

const FOO = "ok\n";

echo(FOO);
echo(\test\ns1\FOO);
echo(\test\ns1\FOO);
echo(BAR);

const BAR = "ok\n";
?>
--EXPECTF--
ok
ok
ok

Fatal error: Uncaught Error: Undefined constant "test\ns1\BAR" in %s:%d
Stack trace:
#0 {main}
  thrown in %s on line %d