Return to ns_036.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / Zend / tests |
1.1 ! misho 1: --TEST-- ! 2: 036: 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 ! 7: namespace A; ! 8: use A as B; ! 9: class ArrayObject { ! 10: const STD_PROP_LIST = 2; ! 11: } ! 12: function f1($x = ArrayObject::STD_PROP_LIST) { ! 13: var_dump($x); ! 14: } ! 15: function f2($x = \ArrayObject::STD_PROP_LIST) { ! 16: var_dump($x); ! 17: } ! 18: function f3($x = \A\ArrayObject::STD_PROP_LIST) { ! 19: var_dump($x); ! 20: } ! 21: function f4($x = B\ArrayObject::STD_PROP_LIST) { ! 22: var_dump($x); ! 23: } ! 24: var_dump(ArrayObject::STD_PROP_LIST); ! 25: var_dump(\ArrayObject::STD_PROP_LIST); ! 26: var_dump(B\ArrayObject::STD_PROP_LIST); ! 27: var_dump(\A\ArrayObject::STD_PROP_LIST); ! 28: f1(); ! 29: f2(); ! 30: f3(); ! 31: f4(); ! 32: ?> ! 33: --EXPECT-- ! 34: int(2) ! 35: int(1) ! 36: int(2) ! 37: int(2) ! 38: int(2) ! 39: int(1) ! 40: int(2) ! 41: int(2)