com php-src: Fixed php_implode with reference: ext/st andard/string.c
| From: | Dmitry Stogov | Date: | Sun, 02 Mar 2014 14:14:25 +0000 |
| Subject: | com php-src: Fixed php_implode with reference: ext/st andard/string.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-77829@lists.php.net to get a copy of this message | ||
Commit: 0f117ef4d9484837220017520b2fbaa36676cda7
Author: Xinchen Hui <laruence@gmail.com> Sun, 2 Mar 2014 22:14:25 +0800
Parents: 92eda10261edf38d53c0134a1ef60aaaeb0755c6
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0f117ef4d9484837220017520b2fbaa36676cda7
Log:
Fixed php_implode with reference
Changed paths:
M ext/standard/string.c
Diff:
diff --git a/ext/standard/string.c b/ext/standard/string.c
index 37a3512..f97417f 100644
--- a/ext/standard/string.c
+++ b/ext/standard/string.c
@@ -1138,6 +1138,7 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC)
zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos);
while ((tmp = zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), &pos)) != NULL) {
+again:
switch (Z_TYPE_P(tmp)) {
case IS_STRING:
smart_str_appendl(&implstr, Z_STRVAL_P(tmp), Z_STRLEN_P(tmp));
@@ -1177,9 +1178,12 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value TSRMLS_DC)
}
}
break;
-
+ case IS_REFERENCE:
+ tmp = Z_REFVAL_P(tmp);
+ goto again;
default:
ZVAL_DUP(&tmp_val, tmp);
+ convert_to_string(&tmp_val);
smart_str_appendl(&implstr, Z_STRVAL(tmp_val), Z_STRLEN(tmp_val));
zval_dtor(&tmp_val);
break;