考虑以下代码:
class some_class extends someother_class
{
function delete()
{
delete($somefile); // <-- That refers to the PHP function called delete
parent::delete(); // <-- That refers to the delete() method in the parent class
}
}
如何在扩展类的delete方法中使用PHP函数delete?
答案 0 :(得分:0)
您应该可以在此使用call_user_func_array()
:
class some_class extends someother_class
{
function delete()
{
call_user_func_array('delete', array($somefile));
parent::delete();
}
}