mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Refactored parameter passing mechanism.
In PHP-5.6 and below each argument passed to user function was copies on VM stack twice. Now we always have ZEND_INIT_FCALL (or simular) opcode that pushes "call frame" on top of VM stack. "Call frame" is actually the same zend_execute_data structure. All the following ZEND_SEND instructions push arguments on top of the stack in a way that they directly comes into corresponding CV variables of the called frame. Extra arguments are copied at the end of stack frame (after all CV and TMP variables) on function enterance. There are two minor incompatibilities: 1) It's not allowed to decalre functions redefining arguments e.g. "function foo($a,$a) {}". 2) func_get_arg() and func_get args() return the current value of argument and not the original value that was sent.
This commit is contained in:
parent
9c96d966bb
commit
b7715c7e8a
26 changed files with 2870 additions and 2926 deletions
|
@ -1102,7 +1102,6 @@ static int do_cli(int argc, char **argv TSRMLS_DC) /* {{{ */
|
|||
|
||||
memset(&execute_data, 0, sizeof(zend_execute_data));
|
||||
EG(current_execute_data) = &execute_data;
|
||||
EX(function_state).function = pce->constructor;
|
||||
zend_call_method_with_1_params(&ref, pce, &pce->constructor, "__construct", NULL, &arg);
|
||||
|
||||
if (EG(exception)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue