Example #1
0
 public static function getInstance()
 {
     if (self::$instance == null) {
         self::$instance = new SingletonType();
     }
     return self::$instance;
 }
Example #2
0
<?php

include __DIR__ . "/singleton.php";
$o = SingletonType::getInstance();
$o->doSomething();