Re: late static binding php6
| From: | Lukas Kahwe Smith | Date: | Mon, 19 Nov 2007 13:57:11 +0000 |
| Subject: | Re: late static binding php6 | ||
| References: | 1 2 3 4 5 6 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-33312@lists.php.net to get a copy of this message | ||
On 19.11.2007, at 14:24, Alexey Zakhlestin wrote:
On 11/19/07, Lukas Kahwe Smith <mls@pooteeweet.org> wrote: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, LukasOn 19.11.2007, at 14:05, Alexey Zakhlestin wrote: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 situationOn 11/19/07, Lukas Kahwe Smith <mls@pooteeweet.org> wrote: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__)?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