Skip to content

Instantly share code, notes, and snippets.

Last active Apr 27, 2021
What would you like to do?
class Singleton {
private static $instance = null;
private function __construct() {
public static function getInstance() {
if (null === 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