public function __construct() { if (self::$instance !== null) { throw new Exception(__CLASS__ . ": singleton pattern"); } self::$instance = $this; parent::__construct(); }