3 ms·
Why didnt they use the term singleton or object?
by diamondo25 6y ago
Why didnt they use the term singleton or object?
- jorams 6y agoWhat would they use it for? The first 'static' means the method is a part of the class rather than the instances of that class. The second and third 'static' indicate late static binding, meaning they refer to the class being called, rather than the class defining this method.
- quietbritishjim 6y ago(Disclaimer: I know absolutely no PHP whatsoever.) > The second and third 'static' indicate late static binding, meaning they refer to the class being called, rather than the class defining this method. Wait, so they're using "static" to mean the binding is happening later? Isn't that essentially less static than binding against the class being defined?
- spdionis 6y agoIt's still static in the sense that the method is tied to a class, not to an object instance. Does that mean it's "less" static? I wouldn't say so.
- quietbritishjim 6y agoWell then I guess we'll have to agree to disagree :-) It's less static than a method dependent on the object instance, but more static than a method that doesn't even depend on the class. If I've understood correctly (which I quite possibly haven't, in fairness), these are analogous to Python's static methods, class methods and regular methods, and its static methods really are the "most" static.