]> granicus.if.org Git - php/commitdiff
seems there is only the stupid way to be stupid (implode copying array
authorSterling Hughes <sterling@php.net>
Wed, 21 May 2003 17:44:08 +0000 (17:44 +0000)
committerSterling Hughes <sterling@php.net>
Wed, 21 May 2003 17:44:08 +0000 (17:44 +0000)
elements)
at least we check for IS_STRING, which should clear this up 90% of the time

ext/standard/string.c

index 5fac07cf70219c04ad9208e535655ebbb8ee471e..8be51df6fa977a2f34d168307469d411dac4be4e 100644 (file)
@@ -837,12 +837,8 @@ PHPAPI void php_implode(zval *delim, zval *arr, zval *return_value)
 
        while (zend_hash_get_current_data_ex(Z_ARRVAL_P(arr), (void **) &tmp, &pos) == SUCCESS) {
                if ((*tmp)->type != IS_STRING) {
-                       if (PZVAL_IS_REF(*tmp)) {
-                               SEPARATE_ZVAL(tmp);
-                               convert_to_string(*tmp);
-                       } else {
-                               convert_to_string_ex(tmp);
-                       }
+                       SEPARATE_ZVAL(tmp);
+                       convert_to_string(*tmp);
                } 
                
                smart_str_appendl(&implstr, Z_STRVAL_PP(tmp), Z_STRLEN_PP(tmp));