summaryrefslogtreecommitdiff
path: root/sapi/cli/php_cli.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-06-30 15:43:45 +0400
committerDmitry Stogov <dmitry@zend.com>2014-06-30 15:43:45 +0400
commitb7715c7e8a6166f84d9c4d6e35bffef853cabc5c (patch)
treeb1681d7735741e41a68ed4d68e9a057065ba2b59 /sapi/cli/php_cli.c
parent9c96d966bbe7e5d3743498539822247fa5763c44 (diff)
downloadphp-git-b7715c7e8a6166f84d9c4d6e35bffef853cabc5c.tar.gz
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.
Diffstat (limited to 'sapi/cli/php_cli.c')
-rw-r--r--sapi/cli/php_cli.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/sapi/cli/php_cli.c b/sapi/cli/php_cli.c
index d353b00a06..ec76f37715 100644
--- a/sapi/cli/php_cli.c
+++ b/sapi/cli/php_cli.c
@@ -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)) {