com php-src: Revered func_get_args() changes, bec ause they were not completly transparent and brok e some tricky PHP code that worked because of
luck before php-5.5.6 (see Bug #6 6107). The changes are going to be ke pt in PHP-5.6.: Zend/zend_builtin_functions .c
| From: | Dmitry Stogov | Date: | Tue, 10 Dec 2013 12:02:59 +0000 |
| Subject: | com php-src: Revered func_get_args() changes, bec ause they were not completly transparent and brok e some tricky PHP code that worked because of luck before php-5.5.6 (see Bug #6 6107). The changes are going to be ke pt in PHP-5.6.: Zend/zend_builtin_functions .c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74332@lists.php.net to get a copy of this message | ||
Commit: a46f644b3ac4abe7577165de4e4850e5c2c88227
Author: Dmitry Stogov <dmitry@zend.com> Tue, 10 Dec 2013 16:02:59 +0400
Parents: a6516653b7ecd0fd73e4129042b1bd305b586171
Branches: PHP-5.5
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=a46f644b3ac4abe7577165de4e4850e5c2c88227
Log:
Revered func_get_args() changes, because they were not completly transparent and broke some tricky
PHP code that worked because of luck before php-5.5.6 (see Bug #66107). The changes are going to be
kept in PHP-5.6.
Bugs:
https://bugs.php.net/66107
Changed paths:
M Zend/zend_builtin_functions.c
Diff:
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 6cbe0bc..1ad64e7 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -461,17 +461,12 @@ ZEND_FUNCTION(func_get_args)
array_init_size(return_value, arg_count);
for (i=0; i<arg_count; i++) {
- zval *element, *arg;
+ zval *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);
- }
+ ALLOC_ZVAL(element);
+ *element = **((zval **) (p-(arg_count-i)));
+ zval_copy_ctor(element);
+ INIT_PZVAL(element);
zend_hash_next_index_insert(return_value->value.ht, &element, sizeof(zval *), NULL);
}
}