请考虑以下PHP类代码
class SuperIdea{
.
.
.
static function getById($id){ new SuperIdea(.......); }
.
.
.
.
}
class SubIdea extends SuperIdea{
}
Run Code Online (Sandbox Code Playgroud)
我在这里面临的问题是,当我调用SubIdea :: getbyId($ t)时; 返回的对象是SuperIdea类型,但我希望它是SubIdea.Is有没有办法实现它而不重复SubIdea中的代码?