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(){ } } ?>
只是查找方便的总结
原文地址:https://www.cnblogs.com/qutao125/p/14608406.html