php-src/Zend/tests/ns_021.phpt
Dmitry Stogov 046b878b5b Fixed name resolution
namespace A;
    B::foo(); // 1. this is function "foo" from namespace "B"
              // 2. this is static method "foo" of class "B" from namespace "A"
              // 3. this is static methos "boo" of internal class "B"
  namespace A;
    A::foo(); // 1. this is function "foo" from namespace "A"
              // 2. this is static method "foo" of class "A" from namespace "A"
              // 3. this is static methos "foo" of internal class "A"
2007-08-22 07:39:37 +00:00

24 lines
311 B
PHP
Executable File

--TEST--
021: Name search priority (first look into namespace)
--FILE--
<?php
namespace test;
class Test {
static function foo() {
echo __CLASS__,"::",__FUNCTION__,"\n";
}
}
function foo() {
echo __FUNCTION__,"\n";
}
foo();
test::foo();
test::test::foo();
--EXPECT--
test::foo
test::foo
test::Test::foo