本文整理汇总了PHP中foo::staticmethod方法的典型用法代码示例。如果您正苦于以下问题:PHP foo::staticmethod方法的具体用法?PHP foo::staticmethod怎么用?PHP foo::staticmethod使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类foo
的用法示例。
在下文中一共展示了foo::staticmethod方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: foo
include __DIR__ . '/_ns-pass-011_inc.php';
const FOO = 2;
function foo()
{
}
class foo
{
static function staticmethod()
{
}
}
/* Unqualified name */
foo();
// resolves to function Foo\Bar\foo
foo::staticmethod();
// resolves to class Foo\Bar\foo, method staticmethod
echo FOO;
// resolves to constant Foo\Bar\FOO
/* Qualified name */
subnamespace\foo();
// resolves to function Foo\Bar\subnamespace\foo
subnamespace\foo::staticmethod();
// resolves to class Foo\Bar\subnamespace\foo,
// method staticmethod
echo subnamespace\FOO;
// resolves to constant Foo\Bar\subnamespace\FOO
/* Fully qualified name */
\Foo\Bar\foo();
// resolves to function Foo\Bar\foo
\Foo\Bar\foo::staticmethod();