| From | Sent On | Attachments |
|---|---|---|
| Etienne Kneuss | Jun 20, 2008 9:03 am | |
| Alexey Zakhlestin | Jun 20, 2008 9:39 am | |
| Stanislav Malyshev | Jun 20, 2008 5:50 pm | |
| Alexey Zakhlestin | Jun 20, 2008 10:53 pm | |
| Etienne Kneuss | Jun 21, 2008 1:57 am | |
| Mike Lively | Jun 21, 2008 7:48 am | |
| Mike Lively | Jun 21, 2008 8:31 am | |
| Lars Strojny | Jun 22, 2008 1:02 pm | |
| Derick Rethans | Jun 22, 2008 1:10 pm | |
| Jochem Maas | Jun 22, 2008 3:44 pm | |
| Etienne Kneuss | Jun 22, 2008 5:05 pm | |
| Jochem Maas | Jun 23, 2008 2:15 am | |
| Mike Lively | Jun 23, 2008 6:35 am | |
| Stanislav Malyshev | Jun 23, 2008 9:56 am | |
| Stanislav Malyshev | Jun 23, 2008 10:22 am | |
| Etienne Kneuss | Jun 23, 2008 11:46 am | |
| Lars Strojny | Jun 23, 2008 1:21 pm | |
| Larry Garfield | Jun 23, 2008 8:43 pm | |
| Alexey Zakhlestin | Jun 23, 2008 10:07 pm | |
| Stanislav Malyshev | Jun 24, 2008 9:37 am | |
| Janusz Lewandowski | Jun 24, 2008 9:52 am | |
| Stanislav Malyshev | Jun 24, 2008 9:59 am | |
| Janusz Lewandowski | Jun 24, 2008 10:14 am | |
| Stanislav Malyshev | Jun 24, 2008 10:32 am | |
| Etienne Kneuss | Jun 24, 2008 11:04 am | |
| Stanislav Malyshev | Jun 24, 2008 11:08 am | |
| Etienne Kneuss | Jun 24, 2008 12:23 pm | |
| Ryan Panning | Jun 24, 2008 12:56 pm |
| Subject: | [PHP-DEV] LSB forward_static_call() | |
|---|---|---|
| From: | Etienne Kneuss (col...@php.net) | |
| Date: | Jun 20, 2008 9:03:50 am | |
| List: | net.php.lists.internals | |
Hi,
Sorry to bring that up again!
Quick summary for people that didn't follow it: LSB was implemented, and it was decided that "explicit calls" ( ClassName::method() ) wouldn't pass the caller info if no fallbacks occured. Some people that were looking forward to having LSB were disappointed as it meant that it wouldn't be possible to sanely overwrite a static method, without loosing info on the caller.
Quick POC: class A { public static function test() { echo get_called_class(); }} class B extends A { public static function test() { echo get_called_class(); parent::test(); } class C extends B; C::test(); // will output CA
To be able to pass information, it was decided to implement a call_user_func-like function that passed the caller info: forward_static_call(_array).
Back then, I was for that solution, but with some time I realized that it would probably be one of those decisions that would bite us back afterward.
To sum up key points about each possibilities:
1) forward_static_call + no need to affect the engine - slow, painful
2) parent:: carries the info while ParentClassName:: doesn't + convenient + no functionnality lost - introduces a difference between parent:: and classname::, but restricted to LSB so no BC break
It really seems like (2) is the most PHP way of doing things, while (1) is more of a hack that we will regret later. The only problem about (2) is that difference, but I really feel (and experienced in the multiple help channels that I'm in) that people already see (wrongly for now) classname:: and parent:: as slightly different. So introducing it as of 5_3 wouldn't be too much of a shock. The point is that: people who uses LSB will be aware of that difference and will use parent:: vs classname:: carefully, while others will be able to ignore it
So, I really would like to revert that foward_static_call stuff and implement the parent:: patch instead, while it's still possible.
thoughts?
-- Etienne Kneuss http://www.colder.ch
Men never do evil so completely and cheerfully as when they do it from a religious conviction. -- Pascal
-- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php





