xref: /PHP-7.4/Zend/tests/ns_036.phpt (revision 1624b0a9)
1--TEST--
2036: Name ambiguity in compile-time constant reference (ns name)
3--FILE--
4<?php
5namespace A;
6use A as B;
7class ArrayObject {
8	const STD_PROP_LIST = 2;
9}
10function f1($x = ArrayObject::STD_PROP_LIST) {
11	var_dump($x);
12}
13function f2($x = \ArrayObject::STD_PROP_LIST) {
14	var_dump($x);
15}
16function f3($x = \A\ArrayObject::STD_PROP_LIST) {
17	var_dump($x);
18}
19function f4($x = B\ArrayObject::STD_PROP_LIST) {
20	var_dump($x);
21}
22var_dump(ArrayObject::STD_PROP_LIST);
23var_dump(\ArrayObject::STD_PROP_LIST);
24var_dump(B\ArrayObject::STD_PROP_LIST);
25var_dump(\A\ArrayObject::STD_PROP_LIST);
26f1();
27f2();
28f3();
29f4();
30?>
31--EXPECT--
32int(2)
33int(1)
34int(2)
35int(2)
36int(2)
37int(1)
38int(2)
39int(2)
40