php-src/Zend/tests/ns_034.phpt

32 lines
352 B
Plaintext
Raw Normal View History

--TEST--
034: Support for namespaces in compile-time constant reference
--FILE--
<?php
namespace A;
2007-11-06 15:29:41 +08:00
use A as B;
class Foo {
const C = "ok\n";
}
function f1($x=Foo::C) {
echo $x;
}
2008-12-05 04:12:30 +08:00
function f2($x=B\Foo::C) {
echo $x;
}
2008-12-05 04:12:30 +08:00
function f3($x=\A\Foo::C) {
echo $x;
}
echo Foo::C;
2008-12-05 04:12:30 +08:00
echo B\Foo::C;
echo \A\Foo::C;
f1();
f2();
f3();
--EXPECT--
ok
ok
ok
ok
ok
ok