'; } function sleep() { echo '猫正在睡觉!'; }}class Dog implements Doing{ function eat() { echo '狗正在吃东西!'; } function sleep() { echo '狗正在睡觉!'; }}class Factory{ static function createDoing(){}}class CatFactory implements Factory{ static function createDoing() { return new Cat(); }}class DogFactory implements Factory{ static function createDoing() { return new Dog(); }}