Annotation of embedaddon/php/Zend/tests/ns_040.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: 040: Constant declaration and usage in namespace
3: --FILE--
4: <?php
5: namespace X;
6: use X as Y;
7: const A = "ok\n";
8: const B = A;
9: function f1($x=A) {
10: echo $x;
11: }
12: function f2($x=\X\A) {
13: echo $x;
14: }
15: function f3($x=Y\A) {
16: echo $x;
17: }
18: function f4($x=\X\A) {
19: echo $x;
20: }
21: function f5($x=B) {
22: echo $x;
23: }
24: function f6($x=array(A)) {
25: echo $x[0];
26: }
27: function f7($x=array("aaa"=>A)) {
28: echo $x["aaa"];
29: }
30: function f8($x=array(A=>"aaa\n")) {
31: echo $x["ok\n"];
32: }
33: echo A;
34: echo \X\A;
35: echo Y\A;
36: echo \X\A;
37: f1();
38: f2();
39: f3();
40: f4();
41: echo B;
42: f5();
43: f6();
44: f7();
45: f8();
46: --EXPECT--
47: ok
48: ok
49: ok
50: ok
51: ok
52: ok
53: ok
54: ok
55: ok
56: ok
57: ok
58: ok
59: aaa
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>