How would one create a Singleton class using PHP5 classes?
protected static $_instance; public static function getInstance() { if(is_null(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; }
This code can apply for any class without caring about its class name.