~~~ <?php class User { protected static $_instance; private function __construct() { } public static function getInstance() { if (is_null(self::$_instance)) { self::$_instance = new self(); } return self::$_instance; } public function sayHello() { return 'Hello World!'; } } echo User::getInstance()->sayHello(); ~~~