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  totau  阅读(21)  评论(0编辑  收藏  举报

导航