单例

来源:互联网 发布:优化党员队伍结构 编辑:程序博客网 时间:2024/04/29 09:48
static $_instance;

    static function getInstance()
    {
        if (is_null(self::$_instance)) {
            self::$_instance = new self();
        }
        return self::$_instance;
    }
原创粉丝点击