class?Car?{
???function?__construct()?{
???????print?"父類構(gòu)造函數(shù)被調(diào)用\n";
???}
}
class?Truck?extends?Car?{
???function?__construct()?{
???????print?"子類構(gòu)造函數(shù)被調(diào)用\n";
???????parent::__construct();
???}
}
$car?=?new?Truck();
class Truck extends Car 是把Car作為Truck的父類的意思?
錯(cuò)過(guò)了年華
2017-02-21 00:00:26