写一个最简单的单例类

final class single{
		protected static $ins=null;
		protected function __construct(){}
		public static function getIns(){
			if(self::$ins==null){
				self::$ins = new self();
			}
			return self::$ins;
		}
		protected function __clone(){}
	}
posted @ 2017-12-07 15:54  小绵羊~~  阅读(361)  评论(0编辑  收藏  举报