Hi Andrea,

Could you measure the performance impact of function referencing.

<?php
$func = "strlen";
for ($i = 0; $i < 10000; $i++) {
    $func("hello");
}
?>

vs

<?php
$func = &strlen;
for ($i = 0; $i < 10000; $i++) {
    $func("hello");
}
?>

I don't like the "&" syntax a lot, but I understand that it's a compromise
between readability and implementation complication.

The patch probably misses support for "&self::foo", "&parent::foo",
"&static::foo".
It also may be improved using run_time cache (this is not important now).

Thanks. Dmitry.



On Mon, Aug 4, 2014 at 1:50 AM, Andrea Faulds <a...@ajf.me> wrote:

> Good evening,
>
> I am proposing two new RFCs. As they are both inter-related and
> complementary, with the second having the first as a prerequisite, I’m
> making just a single email to cover both:
>
> https://wiki.php.net/rfc/closure_apply
> https://wiki.php.net/rfc/function_referencing
>
> Both have written, tested and working patches aimed for master.
>
> Thoughts appreciated, thanks.
> --
> Andrea Faulds
> http://ajf.me/
>
>
>
>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

Reply via email to