Question

When are static properties initialized, as I know other member properties are initialized when object is created.

Thanks

Was it helpful?

Solution

Declaring class properties or methods as static makes them accessible without needing an instantiation of the class. A property declared as static can not be accessed with an instantiated class object (though a static method can).

/ http://php.net/manual/en/language.oop5.static.php

So, they are available after they have been declared.

OTHER TIPS

Static properties? Do you mean static variables or methods?

Either way, they are initialized when the script is parsed, or the class is defined.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top