Skip to content

Instantly share code, notes, and snippets.

@seriiserii825
Created October 6, 2017 14:30
Show Gist options
  • Save seriiserii825/a13fe3fabfad71f539e58de0fa5654bf to your computer and use it in GitHub Desktop.
Save seriiserii825/a13fe3fabfad71f539e58de0fa5654bf to your computer and use it in GitHub Desktop.
singleton
class Singleton
{
protected static $instance;
protected function __construct()
{
}
public static function instance()
{
if (null === static::$instance) {
static::$instance = new static;
}
return static::$instance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment