//接口实现多态 interface USB{ public function run(); } class Mouse implements USB{ public function run(){ echo '鼠标可以使用...<br/>'; } } class Micro implements USB{ public function run(){ echo '麦克风可以使用...<br/>'; } } class Computer{ public function useUSB($usbObj){ $usbObj->run(); } } $computer1=new Computer; $computer1->useUSB(new Mouse); $computer1->useUSB(new Micro);