Re: late static binding php6
| From: | Gergely Hodicska | Date: | Mon, 26 Nov 2007 18:31:53 +0000 |
| Subject: | Re: late static binding php6 | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-33445@lists.php.net to get a copy of this message | ||
Hi!
Of course, we can't make parent:: reference the parent class of the called one, as it would break BC. As in: class A { } class B extends A { public static function test() { echo get_class(new parent), '-', get_parent_class(); } } class C extends B { } C::test(); // A-A and not B-B Maybe you missed the point, nobody wants that this code should returnB-B, the only difference is in the return value of the get_called_class() function (which is not exists yet, so there is no BC). Best Regards, Felhő