【发布时间】:2011-06-13 05:18:15
【问题描述】:
这是一个例子:
class Test {
public function TestMethod() {
print_r($this); // Gives me "Test1 Object ( )"
}
}
class Test1 {
public function Test1Method() {
Test::TestMethod();
}
}
$test1 = new Test1;
$test1->Test1Method();
我觉得这很奇怪。谁能解释一下为什么会这样?
【问题讨论】:
-
我问了一个非常相似的(不是骗子)问题。回复很有帮助stackoverflow.com/questions/516355/…
标签: php oop this static-methods