public static function getInstance() { if (self::$instance == null) { self::$instance = new SingletonType(); } return self::$instance; }
<?php include __DIR__ . "/singleton.php"; $o = SingletonType::getInstance(); $o->doSomething();