这里的$obj是随便定义的吗
function checkEat($obj){
if($obj instanceof ICanEat){
$obj->eat('food');
}else{
echo "The obj can't eat.\n";
}
}
function checkEat($obj){
if($obj instanceof ICanEat){
$obj->eat('food');
}else{
echo "The obj can't eat.\n";
}
}
2018-01-28
举报