From: Sterling Hughes Date: Wed, 21 May 2003 17:38:17 +0000 (+0000) Subject: be stupid, but at least be smart about being stupid. X-Git-Tag: RELEASE_1_0_2~653 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=90ae4e00957d7d3f3a4b50a0881c075c9020f591;p=php be stupid, but at least be smart about being stupid. --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 020eb430b3..5fac07cf70 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -836,8 +836,15 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value) zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(arr), &pos); while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **) &tmp, &pos) == SUCCESS) { - convert_to_string_ex(tmp); - + if ((*tmp)->type != IS_STRING) { + if (PZVAL_IS_REF(*tmp)) { + SEPARATE_ZVAL(tmp); + convert_to_string(*tmp); + } else { + convert_to_string_ex(tmp); + } + } + smart_str_appendl(&implstr, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp)); if (++i != numelems) { smart_str_appendl(&implstr, Z_STRVAL_P(delim), Z_STRLEN_P(delim));