Re: LSB forward_static_call()
| From: | Etienne Kneuss | Date: | Sat, 21 Jun 2008 08:58:19 +0000 |
| Subject: | Re: LSB forward_static_call() | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-38498@lists.php.net to get a copy of this message | ||
Hello,
On Sat, Jun 21, 2008 at 2:51 AM, Stanislav Malyshev <stas@zend.com> wrote:
> Hi!
>
>> So, I really would like to revert that foward_static_call stuff and
>> implement the parent:: patch instead, while it's still possible.
>>
>> thoughts?
>
> Didn't we discuss that already? Adding magic to parent:: is not a good
> idea, it's very basic language construct and should work simple. LSB is
> an advanced feature, which probably would be used deep inside library guts
> and thus can use more elaborate syntax.
It seems natural to think of LSB as a language feature, and so it
doesn't feel right to have it partly implemented as a keyword, and
then fix the problematic part as function.
We already see how call_user_func is painful to use (i.e. with methods
that use references), that same burden will be put on
forward_static_call.
> On top of that, by making parent:: forward called class name, you remove
> the possibility of doing non-forwarding call to the parent class.
Why would that be no longer possible ? If you want to make a
non-forwarding call to the parent class, you can use
TheParentClassName::foo();.
>
> As for it being slow - how slow it is? Does it really so slow that it
> makes real-life application that otherwise would be fast to be slow? Or
> it's just "couple more CPU cycles" slow? I suspect the latter - and thus
> I don't think speed optimizations belong there.
It's about 85% slower than a direct call. Sure it's not that slow when
measuring absolutely, but we're talking about a feature that will be
typically used in frameworks and libraries, so the amount of calls may
be quite big.
> --
> Stanislav Malyshev, Zend Software Architect
> stas@zend.com http://www.zend.com/
> (408)253-8829 MSN: stas@zend.com
>
>
>
--
Etienne Kneuss
http://www.colder.ch
Men never do evil so completely and cheerfully as
when they do it from a religious conviction.
-- Pascal