class Singleton {
private static $instance = null;
private function __construct(){
//do something
}
public static function getInstance(){
self::$instance !== null ?: self::$instance = new self();
return self::$instance;
}
}