1
可能重複:
PHP: call to an instance method via ClassName::method syntax, results in a static call ?!爲什麼可以這樣調用非靜態成員函數?
class A
{
function foo()
{
if (isset($this)) {
echo '$this is defined (';
echo get_class($this);
echo ")\n";
} else {
echo "\$this is not defined.\n";
}
}
}
A::foo();
這是一個錯誤或功能?
這是問剛纔:http://stackoverflow.com/questions/4664511/php-call-to-an-instance-method-via-classnamemethod-syntax-results-in-a-static – BoltClock 2011-01-12 03:53:06