为什么这会返回“严格标准”通知?:
'Strict Standards: Non-static method main::i() should not be called statically in...'
class main
{
public function __construct()
{
echo "in main class";
}
public function i()
{
echo "i in main";
}
}
class secondary extends main
{
public static function tom()
{
parent::i();
}
}
secondary::tom();
我合法地调用了一个静态方法,其中包含对父类中非静态方法的调用。