不明白最后一句
class Car {
function __construct() {
print "父类构造函数被调用\n";
}
}
class Truck extends Car {
function __construct() {
print "子类构造函数被调用\n";
parent::__construct();
}
}
$car = new Truck();
class Car {
function __construct() {
print "父类构造函数被调用\n";
}
}
class Truck extends Car {
function __construct() {
print "子类构造函数被调用\n";
parent::__construct();
}
}
$car = new Truck();
2016-07-05
举报