public function __construct() { $this->errmsg = "_XY_OK_"; static $inited = false; //只初始化一次 if ($inited) { return; } self::$db = get_class($this) == "XYMysql" ? $this : new XYMysql(); $inited = true; }
function __construct() { $this->connect(); parent::__construct(); }