/var/www/hkosl.com/demo_google/application/vendor/phpunit/phpunit/tests/_files/Singleton.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<?php
class Singleton
{
    private static 
$uniqueInstance null;

    protected function 
__construct()
    {
    }

    final private function 
__clone()
    {
    }

    public static function 
getInstance()
    {
        if (
self::$uniqueInstance === null) {
            
self::$uniqueInstance = new self;
        }

        return 
self::$uniqueInstance;
    }
}