I’m using PHP as my programming language. I really don’t understand the use of static method and variables.
- When a methold should be static?/ What methods should be static ?
- How to identify what methold should be static?
- Pros and Cons static method and variables ?
Thanks
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
“it can be initiated with out an OBJECT”