mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
Improved performance of func_get_args() by eliminating useless copying
This commit is contained in:
parent
f8f643b4f7
commit
91b8a6752e
2
NEWS
2
NEWS
@ -3,6 +3,8 @@ PHP NEWS
|
||||
?? ??? 2013, PHP 5.5.6
|
||||
|
||||
- Core:
|
||||
. Improved performance of func_get_args by eliminating useless copying.
|
||||
(Dmitry)
|
||||
. Fixed bug #65939 (Space before ";" breaks php.ini parsing).
|
||||
(brainstorm at nopcode dot org)
|
||||
. Fixed bug #65911 (scope resolution operator - strange behavior with $this).
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user