function checkEat($obj){ if($obj instanceof ICanEat){ $obj->eat('food'); }else{ echo "The obj can't eat.\n"; } }
是的,除了保留字以外并且符合规范可以任意命名。