douxin1884 2015-07-16 15:54
浏览 54
已采纳

PHP 5.6 Singleton?

I just copied singleton template from phptherightway

I use PHP 5.6.3 (cli) And I got this error:

singleton error

Can somebody explain this ?

  • 写回答

1条回答 默认 最新

  • dongwuxie7976 2015-07-16 16:01
    关注

    It's the late static binding against a private property that's causing the problems.

    Either modify the visibility of $instance to protected

    Or modify the references to static::$instance in getInstance() to self::$instance

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Linux环境下CA证书更新问题
  • ¥15 sqlserver语句提取结果以外数据
  • ¥60 微信小程序如何上传QQ聊天文件
  • ¥300 开发的系统遭到无良商家的破解,请问如何防止再次发生,并追回损失
  • ¥15 java代码写在记事本上后在cmd上运行时无报错但又没生成文件
  • ¥15 关于#python#的问题:在跑ldsc数据整理的时候一直抱这种错误,要么--out识别不了参数,要么--merge-alleles识别不了参数(操作系统-linux)
  • ¥15 PPOCRLabel
  • ¥15 混合键合键合机对准标识
  • ¥100 现在不懂的是如何将当前的相机中的照片,作为纹理贴图,映射到扫描出的模型上
  • ¥15 安卓OpenCV人脸识别分类器加载