Hacker News new | past | comments | ask | show | jobs | submit login

What 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.



(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?


It'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.


Well 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: