diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2020-04-06 12:46:52 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2020-07-31 15:53:36 +0200 |
commit | d92229d8c78aac25925284e23aa7903dca9ed005 (patch) | |
tree | ec01712dbe44a11cb7368492388cb39ab04dac17 /ext/pcre/php_pcre.c | |
parent | 9a71d47d7334b9e2f83db48498047750c04cd192 (diff) | |
download | php-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/pcre/php_pcre.c')
-rw-r--r-- | ext/pcre/php_pcre.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 8138dd5e69..acaeb19dc6 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -2400,6 +2400,7 @@ PHP_FUNCTION(preg_replace_callback_array) fci.size = sizeof(fci); fci.object = NULL; + fci.named_params = NULL; ZEND_HASH_FOREACH_STR_KEY_VAL(pattern, str_idx_regex, replace) { if (!str_idx_regex) { |