public static function getInstance() { if (is_null(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
/** * Allow only one instance of this class exist * for a single request */ public static function instance() { $called = get_called_class(); if (self::$instance instanceof self) { return self::$instance; } return self::$instance = new self(); }
public static function getInstance() { return self::$_instance ?: (self::$_instance = new self()); }