As of php 5.3, the static
keyword resolved the late static binding issue and it can be used like most other OO languages use self
. In PHP self
still exists.
I know how the two keywords are separate functionally as previously pointed out in this question: Is there any reason to use the self keyword?.
However, my question is: Can anyone give a reason why you would want to use self
in code meant to run only with 5.3 or later PHP? Does self
have better performance? I've yet to find any compelling use case for using the self
keyword anymore. My understanding is it only remains to allow old libraries to continue working in an expected manner.
The key to the question is can anyone suggest a good reason, ANY GOOD REASON, just one, tiny, little, reason that makes sense for a competent PHP developer to say "Gee, here I should really use 'self' instead of 'static'."
Because you might want to shoot yourself in the foot and that's a reason to use it isn't a good reason.