diff options
author | Yasuo Ohgaki <yohgaki@php.net> | 2013-10-28 18:38:22 +0900 |
---|---|---|
committer | Yasuo Ohgaki <yohgaki@php.net> | 2013-10-28 18:38:22 +0900 |
commit | 0db6adda48681fae147dfa952ce03e4ffc1b94c2 (patch) | |
tree | eece42fd18ef882e7510312b97af8bacc5438531 | |
parent | 66fe7fabadd0b908828c865273d1fe3db2b7159b (diff) | |
parent | 91b8a6752e2d987ff7b1ee10c343dcba13c94914 (diff) | |
download | php-git-0db6adda48681fae147dfa952ce03e4ffc1b94c2.tar.gz |
Merge branch 'PHP-5.5' of git.php.net:php-src into PHP-5.5
* 'PHP-5.5' of git.php.net:php-src:
Improved performance of func_get_args() by eliminating useless copying
Link to more readmes
-rw-r--r-- | README.md | 11 | ||||
-rw-r--r-- | Zend/zend_builtin_functions.c | 15 |
2 files changed, 20 insertions, 6 deletions
@@ -17,7 +17,7 @@ See https://wiki.php.net/rfc and https://wiki.php.net/rfc/voting for more information on the process. Bug fixes **do not** require an RFC, but require a bugtracker ticket. Always -open a ticket at http://bugs.php.net and reference the bug id using #NNNNNN. +open a ticket at https://bugs.php.net and reference the bug id using #NNNNNN. Fix #55371: get_magic_quotes_gpc() throws deprecation warning @@ -28,3 +28,12 @@ open a ticket at http://bugs.php.net and reference the bug id using #NNNNNN. We do not merge pull requests directly on github. All PRs will be pulled and pushed through http://git.php.net. + + +Guidelines for contributors +=========================== +- [CODING_STANDARDS](/CODING_STANDARDS) +- [README.GIT-RULES](/README.GIT-RULES) +- [README.MAILINGLIST_RULES](/README.MAILINGLIST_RULES) +- [README.RELEASE_PROCESS](/README.RELEASE_PROCESS) + diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 1ad64e74ea..6cbe0bc687 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -461,12 +461,17 @@ ZEND_FUNCTION(func_get_args) array_init_size(return_value, arg_count); for (i=0; i<arg_count; i++) { - zval *element; + zval *element, *arg; - ALLOC_ZVAL(element); - *element = **((zval **) (p-(arg_count-i))); - zval_copy_ctor(element); - INIT_PZVAL(element); + arg = *((zval **) (p-(arg_count-i))); + if (!Z_ISREF_P(arg)) { + element = arg; + Z_ADDREF_P(element); + } else { + ALLOC_ZVAL(element); + INIT_PZVAL_COPY(element, arg); + zval_copy_ctor(element); + } zend_hash_next_index_insert(return_value->value.ht, &element, sizeof(zval *), NULL); } } |