我有一个子类,我在其中定义了一个静态函数:
class functionover
{
function override($num1, $num2)
{
$total = $num1+$num2;
}
}
class childfunctionover extends functionover
{
static function override($num1, $num2)
{
$sum = $num1+$num2;
}
}
functionover :: override(10, 20);
当我运行我的程序时,它显示错误:
Cannot make non static method functionover::override() static in class childfunctionover
怎么来的?