<?php class Car { private function __construct(){ echo 'object creat'; } private static $_object = null; public static function getInstance(){ if(empty(self::$_object)){ self::$object = new Car(); }
<?php class Car { private function __construct(){ echo 'object creat'; } private static $_object = null; public static function getInstance(){ if(empty(self::$_object)){ self::$object = new Car(); }