summaryrefslogtreecommitdiff
path: root/ext/opcache/zend_file_cache.c
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2020-04-06 12:46:52 +0200
committerNikita Popov <nikita.ppv@gmail.com>2020-07-31 15:53:36 +0200
commitd92229d8c78aac25925284e23aa7903dca9ed005 (patch)
treeec01712dbe44a11cb7368492388cb39ab04dac17 /ext/opcache/zend_file_cache.c
parent9a71d47d7334b9e2f83db48498047750c04cd192 (diff)
downloadphp-git-d92229d8c78aac25925284e23aa7903dca9ed005.tar.gz
Implement named parameters
From an engine perspective, named parameters mainly add three concepts: * The SEND_* opcodes now accept a CONST op2, which is the argument name. For now, it is looked up by linear scan and runtime cached. * This may leave UNDEF arguments on the stack. To avoid having to deal with them in other places, a CHECK_UNDEF_ARGS opcode is used to either replace them with defaults, or error. * For variadic functions, EX(extra_named_params) are collected and need to be freed based on ZEND_CALL_HAS_EXTRA_NAMED_PARAMS. RFC: https://wiki.php.net/rfc/named_params Closes GH-5357.
Diffstat (limited to 'ext/opcache/zend_file_cache.c')
-rw-r--r--ext/opcache/zend_file_cache.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/opcache/zend_file_cache.c b/ext/opcache/zend_file_cache.c
index 81034a38fe..9e9463c8fd 100644
--- a/ext/opcache/zend_file_cache.c
+++ b/ext/opcache/zend_file_cache.c
@@ -415,7 +415,8 @@ static void zend_file_cache_serialize_attribute(zval *zv,
SERIALIZE_STR(attr->lcname);
for (i = 0; i < attr->argc; i++) {
- zend_file_cache_serialize_zval(&attr->argv[i], script, info, buf);
+ SERIALIZE_STR(attr->args[i].name);
+ zend_file_cache_serialize_zval(&attr->args[i].value, script, info, buf);
}
}
@@ -1180,7 +1181,8 @@ static void zend_file_cache_unserialize_attribute(zval *zv, zend_persistent_scri
UNSERIALIZE_STR(attr->lcname);
for (i = 0; i < attr->argc; i++) {
- zend_file_cache_unserialize_zval(&attr->argv[i], script, buf);
+ UNSERIALIZE_STR(attr->args[i].name);
+ zend_file_cache_unserialize_zval(&attr->args[i].value, script, buf);
}
}