Hi,
Please review the patch.
It improves implementation of magic __call() and __callstatic() methods
using bytecode function with trampoline instead of internal C function.
https://github.com/php/php-src/pull/1234
The patch is more or less obvious.
I'm going to commit it tomorrow evening.
Xinchen, you may also try to add support for Closure::invoke() (as a
separate patch).
Thanks. Dmitry.
Hi Dmitry,
Although I recommend against the usage of __call/__callStatic from a
quality assurance perspective (part of my job), it's reassuring to know
that these methods have received more attention in terms of stability and
stack handling.
After reviewing the code I'd still like to better understand the use of the
term trampoline and when it's appropriate to
use zend_get_call_trampoline_func() over the
existing zend_get_user_call_function() approach.
Many thanks,
Paul
Hi,
Please review the patch.
It improves implementation of magic __call() and __callstatic() methods
using bytecode function with trampoline instead of internal C function.https://github.com/php/php-src/pull/1234
The patch is more or less obvious.
I'm going to commit it tomorrow evening.Xinchen, you may also try to add support for Closure::invoke() (as a
separate patch).Thanks. Dmitry.
Hi Dmitry,
Although I recommend against the usage of __call/__callStatic from a
quality assurance perspective (part of my job), it's reassuring to know
that these methods have received more attention in terms of stability and
stack handling.After reviewing the code I'd still like to better understand the use of
the term trampoline and when it's appropriate to
use zend_get_call_trampoline_func() over the
existing zend_get_user_call_function() approach.
In our approach, "trampline" is a special opcode, that substitute existing
"fake" stack frame with a frame to __call() function, similar to tail-call.
Thanks. Dmitry.
Many thanks,
PaulHi,
Please review the patch.
It improves implementation of magic __call() and __callstatic() methods
using bytecode function with trampoline instead of internal C function.https://github.com/php/php-src/pull/1234
The patch is more or less obvious.
I'm going to commit it tomorrow evening.Xinchen, you may also try to add support for Closure::invoke() (as a
separate patch).Thanks. Dmitry.