]> granicus.if.org Git - php/commitdiff
oci8 to 3.0.9
authorThies C. Arntzen <thies@php.net>
Wed, 9 Jun 1999 19:47:06 +0000 (19:47 +0000)
committerThies C. Arntzen <thies@php.net>
Wed, 9 Jun 1999 19:47:06 +0000 (19:47 +0000)
implode works!

ext/oci8/oci8.c
ext/standard/string.c

index 6008701e670396e207ab74b3f3b01b945352f5e1..4ab77faa9a82dd5d601bbd8ea6e147593bf31796 100644 (file)
@@ -3146,13 +3146,17 @@ PHP_FUNCTION(oci8_fetchinto)
                        php3_error(E_WARNING, "OCIFetchInto: unable to convert arg 2 to array");
                        RETURN_FALSE;
                }
+
+/*
+               array->is_ref = 0;
+               array->refcount = 1;
+*/
        }
 
 #if PHP_API_VERSION < 19990421
        element = emalloc(sizeof(pval));
 #endif
 
-
        for (i = 0; i < statement->ncolumns; i++) {
                column = oci8_get_col(statement, i + 1, 0, "OCIFetchInto");
                if (column == NULL) { /* should not happen... */
@@ -3165,6 +3169,8 @@ PHP_FUNCTION(oci8_fetchinto)
 
 #if PHP_API_VERSION >= 19990421
                element = emalloc(sizeof(pval));
+               element->is_ref = 0;
+               element->refcount = 1;
 #endif
 
                if ((mode & OCI_NUM) || (! (mode & OCI_ASSOC))) { /* OCI_NUM is default */
index 139911c72dfec8ebb60f9559fcd61ee8e436941f..bfc66735a921157308900e7e03a7c64b764ebe73 100644 (file)
@@ -306,7 +306,7 @@ PHP_FUNCTION(explode)
    Join array elements placing glue string between items and return one string */
 PHP_FUNCTION(implode)
 {
-       pval *arg1, *arg2, *delim, *tmp, *arr;
+       pval *arg1, *arg2, *delim, **tmp, *arr;
        int len = 0, count = 0;
        
        if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
@@ -329,9 +329,9 @@ PHP_FUNCTION(implode)
        /* convert everything to strings, and calculate length */
        _php3_hash_internal_pointer_reset(arr->value.ht);
        while (_php3_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) {
-               convert_to_string(tmp);
-               if (tmp->type == IS_STRING) {
-                       len += tmp->value.str.len;
+               convert_to_string(*tmp);
+               if ((*tmp)->type == IS_STRING) {
+                       len += (*tmp)->value.str.len;
                        if (count>0) {
                                len += delim->value.str.len;
                        }
@@ -346,9 +346,9 @@ PHP_FUNCTION(implode)
        return_value->value.str.val[len] = '\0';
        _php3_hash_internal_pointer_reset(arr->value.ht);
        while (_php3_hash_get_current_data(arr->value.ht, (void **) &tmp) == SUCCESS) {
-               if (tmp->type == IS_STRING) {
+               if ((*tmp)->type == IS_STRING) {
                        count--;
-                       strcat(return_value->value.str.val, tmp->value.str.val);
+                       strcat(return_value->value.str.val, (*tmp)->value.str.val);
                        if (count > 0) {
                                strcat(return_value->value.str.val, delim->value.str.val);
                        }
@@ -356,6 +356,8 @@ PHP_FUNCTION(implode)
                _php3_hash_move_forward(arr->value.ht);
        }
        return_value->type = IS_STRING;
+       return_value->refcount = 1;
+       return_value->is_ref = 0;
        return_value->value.str.len = len;
 }
 /* }}} */