2015-03-07 12:34
浏览 324


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?

图片转代码服务由CSDN问答提供 功能建议

我创建了一个几乎只有静态函数的类。 现在我想在我的类中设置一些默认设置,但我想使用我的类而不创建它的实例。


  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongliechuich10319 2015-03-07 12:39

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

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

    点赞 打赏 评论

相关推荐 更多相似问题