Guest User

Untitled

a guest
Jun 22nd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. <?php
  2. class Foo
  3. {
  4. private static $_instance = null;
  5.  
  6. public static function getInstance()
  7. {
  8. if (self::$_instance === null) {
  9. self::$_instance = new self();
  10. }
  11.  
  12. return self::$_instance;
  13. }
  14.  
  15. private function __construct()
  16. {
  17. }
  18. }
Add Comment
Please, Sign In to add comment