self:$instance =& $this,该怎么处理

WBOY
Release: 2016-06-13 13:47:50
Original
1608 people have browsed it

self::$instance =& $this
class CI_Base {

private static $instance;

public function CI_Base()
{
self::$instance =& $this;
}

public static function &get_instance()
{
return self::$instance;
}
}

function &get_instance()
{
return CI_Base::get_instance();
}这个类有什么作用

------解决方案--------------------
为了兼容PHP4
------解决方案--------------------
google "单例模式" 
再结合楼上的回复

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template