public static function instance() { if (!self::$_instance) { self::$_instance = new Application(); } return self::$_instance; }
public static function getInstance() { if (null === self::$_instance) { self::$_instance = new self(); } return self::$_instance; }
/** * 创建一个自身的单例对象 * * @return self */ public static function getInstance() { if (!isset(self::$_instance) || !is_object(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
public static function getInstance() { if (self::$_instance !== null) { return self::$_instance; } else { self::$_instance = new self(); return self::$_instance; } }