On 19.11.2007, at 14:24, Alexey Zakhlestin wrote:

On 11/19/07, Lukas Kahwe Smith <[EMAIL PROTECTED]> wrote:

On 19.11.2007, at 14:05, Alexey Zakhlestin wrote:

On 11/19/07, Lukas Kahwe Smith <[EMAIL PROTECTED]> wrote:

I think the point of Stas reply was to use self:: instead of
parent::.

how would self help? that would mean calling this exact method, not
the method of parent-class

that way you could add the class name as a second parameter to the
parent method, without having to type it out in every call. Anyways,
I think the current situation is quite clear to me. then again, I
forgot if we also added new magic constants to go along with
__CLASS__ for this (aka __SELF__)?

that's possible, but some more "magic" seems to be "natural" here.

As I and several others proposed earlier the best option would be:

parent::method() thinks it is the same class as a caller
ClassName::method() thinks it is ClassName

this would be the least-surprise situation

actually i do not think this is obviously more intuitive than what we currently have. also that would introduce BC issues. so i think adding some new magic constants (if they are not yet added) would probably solve the situation more or less, plus you have self:: if you need to do something more complex. of course it adds some more method calls.

regards,
Lukas

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to