<?php class sing { private static $instence = null; private function __construct() { } private function __clone() { } public static function getinstence(){ if (empty(self::$instence)) { self::$instence = new sing(); } return self::$instence; } }
懒汉式