PHP设计模式-单例

<?php
/**
* 三私一公
*/
class singleSimple{ private static $instante = ''; private function __construct(){ } public static function instanteMethod(){ if(self::$instante == ''){ self::$instante =new singleSimple(); } return self::$instante; } private function __clone(){ } } ?>

 

posted on 2021-04-01 22:01  渠涛涛  阅读(25)  评论(0)    收藏  举报

导航