2007-07-27 17:04:12 +08:00
|
|
|
--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;
|
2007-07-27 17:04:12 +08:00
|
|
|
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) {
|
2007-07-27 17:04:12 +08:00
|
|
|
echo $x;
|
|
|
|
}
|
2008-12-05 04:12:30 +08:00
|
|
|
function f3($x=\A\Foo::C) {
|
2007-07-27 17:04:12 +08:00
|
|
|
echo $x;
|
|
|
|
}
|
|
|
|
echo Foo::C;
|
2008-12-05 04:12:30 +08:00
|
|
|
echo B\Foo::C;
|
|
|
|
echo \A\Foo::C;
|
2007-07-27 17:04:12 +08:00
|
|
|
f1();
|
|
|
|
f2();
|
|
|
|
f3();
|
|
|
|
--EXPECT--
|
|
|
|
ok
|
|
|
|
ok
|
|
|
|
ok
|
|
|
|
ok
|
|
|
|
ok
|
|
|
|
ok
|