Created
April 19, 2012 22:08
-
-
Save Twipped/2424548 to your computer and use it in GitHub Desktop.
Quick and dirty Singleton class
This file contains hidden or 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
| class BadExample { | |
| static function Singleton() { | |
| static $o; | |
| if (!$o) $o = new static(); | |
| return $o; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment