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