简体   繁体   中英

Does __construct get called on static functions

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?

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM