dongyan7950 2015-03-07 12:34
浏览 483
已采纳

__construct是否在静态函数上调用

I have created a class with almost only static functions. Now i want to set some default settings in my class, but i want to use my class without creating an instance of it.

Does the __constructor get called when you use your class without creating an instance of it?

  • 写回答

1条回答 默认 最新

  • dongliechuich10319 2015-03-07 12:39
    关注

    __construct() is not being called when calling a static method.

    Class::staticMethod() call does not invoke __construct()

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

报告相同问题?

悬赏问题

  • ¥15 彩灯控制电路,会的加我QQ1482956179
  • ¥200 相机拍直接转存到电脑上 立拍立穿无线局域网传
  • ¥15 (关键词-电路设计)
  • ¥15 如何解决MIPS计算是否溢出
  • ¥15 vue中我代理了iframe,iframe却走的是路由,没有显示该显示的网站,这个该如何处理
  • ¥15 操作系统相关算法中while();的含义
  • ¥15 CNVcaller安装后无法找到文件
  • ¥15 visual studio2022中文乱码无法解决
  • ¥15 关于华为5g模块mh5000-31接线问题
  • ¥15 keil L6007U报错