Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Singleton
- {
- private static $instance = null;
- private function __construct() {}
- private function __clone() {}
- public static function getInstance() {
- if (is_null(Singleton::$instance)) {
- self::$instance = new static();
- }
- return self::$instance;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement