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

__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()

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

报告相同问题?