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));