Skip to content

Instantly share code, notes, and snippets.

@edwinschaap
Created April 19, 2010 08:20
Show Gist options
  • Save edwinschaap/370840 to your computer and use it in GitHub Desktop.
Save edwinschaap/370840 to your computer and use it in GitHub Desktop.
class Singleton
{
private static $_instance;
private function __construct() {}
private function __clone() {}
public static function getInstance()
{
if ( !self::$_instance )
{
self::$_instance = new self();
}
return self::$_instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment