子类继承带有参数的父类的构造方法:
class students{ var $name,$age,$sex; function __construct($name,$age,$sex){ $this->name = $name; $this->age = $age; $this->sex = $sex; } } class master extends students{ var $hobby,$address; function __construct($name, $age, $sex,$hobby,$address){ parent::__construct($name, $age, $sex); $this->hobby = $hobby; $this->address = $address; } }