Created
March 23, 2021 19:59
-
-
Save Nicscott01/a87694ce4092380b2054b657a25a997d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ClassName { | |
/** | |
* Instance | |
*/ | |
public static $instance = null; | |
/** | |
* Singleton | |
*/ | |
public static function get_instance() { | |
if ( self::$instance == null ) { | |
self::$instance = new self; | |
} | |
return self::$instance; | |
} | |
} | |
//Instantiate | |
ClassName::get_instance(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment