PHP-如果我们在php中创建子类的对象,它会调用父类构造函数,然后调用像Java这样的clild类构造函数吗?
No, you need to call the parent constructor in child class.
public function __construct() {
parent::__construct();
//...other code
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.