final class A{
private static $ins = null;
private function __construct(){}
private function __clone(){}
public static function getIns(){
if(self::$ins instanceof self){
return self::$ins;
}
self::$ins = new self();
return self::$ins;
}
}
private static $ins = null;
private function __construct(){}
private function __clone(){}
public static function getIns(){
if(self::$ins instanceof self){
return self::$ins;
}
self::$ins = new self();
return self::$ins;
}
}
2015-08-15
test()方法中的手机号18933334444没有存入数据库。因为mobile的值被index()方法中User对象的mobile覆盖掉了。
2015-08-13