private function __construct() { $this->conn = mysql_connect('localhost', 'root', ''); }
public function __construct($port){ //重写了继承过父类的参数 //有了保险,选继承父类的构造函数 parent::__construct(); $this->prot = $port; $this->conn = mysql_connect("localhost:$prot", 'root', '123456'); echo $this->port,'----<br/>'; }