]> granicus.if.org Git - php/commitdiff
Forgot to set_compare_func in the new array functions, had only tested
authorStig Venaas <venaas@php.net>
Sun, 11 Jun 2000 12:20:42 +0000 (12:20 +0000)
committerStig Venaas <venaas@php.net>
Sun, 11 Jun 2000 12:20:42 +0000 (12:20 +0000)
with older source.

ext/standard/array.c

index 72462a245c4b18a2d1eff800103b146d1de2c637..9c154dc7b826310a882350c9e0bb585e888b1c69 100644 (file)
@@ -2175,6 +2175,7 @@ PHP_FUNCTION(array_unique)
        for (i = 0, p = target_hash->pListHead; p; i++, p = p->pListNext)
                arTmp[i] = p;
        arTmp[i] = NULL;
+    set_compare_func(SORT_REGULAR);
        qsort((void *) arTmp, i, sizeof(Bucket *), array_data_compare);
 
        /* go through the sorted array and delete duplicates from the copy */
@@ -2220,6 +2221,7 @@ PHP_FUNCTION(array_intersect)
        /* for each argument, create and sort list with pointers to the hash buckets */
        lists = (Bucket ***)emalloc(argc * sizeof(Bucket **));
        ptrs = (Bucket ***)emalloc(argc * sizeof(Bucket **));
+    set_compare_func(SORT_REGULAR);
        for (i=0; i<argc; i++) {
                if ((*args[i])->type != IS_ARRAY) {
                        php_error(E_WARNING, "Argument #%d to array_intersect() is not an array", i+1);
@@ -2317,6 +2319,7 @@ PHP_FUNCTION(array_diff)
        /* for each argument, create and sort list with pointers to the hash buckets */
        lists = (Bucket ***)emalloc(argc * sizeof(Bucket **));
        ptrs = (Bucket ***)emalloc(argc * sizeof(Bucket **));
+    set_compare_func(SORT_REGULAR);
        for (i=0; i<argc; i++) {
                if ((*args[i])->type != IS_ARRAY) {
                        php_error(E_WARNING, "Argument #%d to array_intersect() is not an array", i+1);