数据库类实现单利模式
class Database{ static protected $db; private function __construct(){ } static function getInstance(){ echo 111; if(self::$db){ return self::$db; }else{ self::$db = new self(); return self::$db; } } function where($where){ return $this; } function order($order){ return $this; } function limit($limit){ return $this; } }