<?php
namespace Foobar;
class Foo {
static public function test($name) {
print '[['. $name .']]';
}
}
spl_autoload_register(__NAMESPACE__ .'::Foo::test'); // As of PHP 5.3.0
new InexistentClass;
?>
请问一下大家spl_autoload_register(__NAMESPACE__ .'::Foo::test'); // As of PHP 5.3.0
里面的::Foo::test是什么写法? ::Foo代表的什么?调用类为什么要加"::"呢?调用方法test为什么不用加()呢?
namespace Foobar;
class Foo {
static public function test($name) {
print '[['. $name .']]';
}
}
spl_autoload_register(__NAMESPACE__ .'::Foo::test'); // As of PHP 5.3.0
new InexistentClass;
?>
请问一下大家spl_autoload_register(__NAMESPACE__ .'::Foo::test'); // As of PHP 5.3.0
里面的::Foo::test是什么写法? ::Foo代表的什么?调用类为什么要加"::"呢?调用方法test为什么不用加()呢?
