PHP 5.6 单例?
PHP 5.6 Singleton?
我刚刚从 phptherightway
复制了单例模板
我使用 PHP 5.6.3 (cli) 我得到了这个错误:
有人可以解释一下吗?
导致问题的原因是针对私有 属性 的后期静态绑定。
要么将$instance
的可见性修改为protected
或将getInstance()
中对static::$instance
的引用修改为self::$instance
我刚刚从 phptherightway
复制了单例模板我使用 PHP 5.6.3 (cli) 我得到了这个错误:
有人可以解释一下吗?
导致问题的原因是针对私有 属性 的后期静态绑定。
要么将$instance
的可见性修改为protected
或将getInstance()
中对static::$instance
的引用修改为self::$instance