php-src/Zend/tests/ns_001.phpt

35 lines
433 B
Plaintext
Raw Normal View History

2007-09-28 19:52:53 +00:00
--TEST--
001: Class in namespace
--FILE--
<?php
namespace test\ns1;
2007-09-28 19:52:53 +00:00
class Foo {
function __construct() {
echo __CLASS__,"\n";
}
function bar() {
echo __CLASS__,"\n";
}
static function baz() {
echo __CLASS__,"\n";
}
}
$x = new Foo;
$x->bar();
Foo::baz();
$y = new \test\ns1\Foo;
2007-09-28 19:52:53 +00:00
$y->bar();
\test\ns1\Foo::baz();
2007-09-28 19:52:53 +00:00
--EXPECT--
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo
test\ns1\Foo