Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class SomeClass {
- private static $instance;
- public static function getInstance() {
- if (!$this->instance) {
- return $this->instance = new static;
- }
- return this->instance;
- }
- }
- // Could be:
- class Container {
- public static saved function getInstance() {
- return new static;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment