From: Stig Venaas Date: Sun, 11 Jun 2000 12:20:42 +0000 (+0000) Subject: Forgot to set_compare_func in the new array functions, had only tested X-Git-Tag: php-4.0.1RC~277 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=2e738b519f5b74a81a199ea7df20ec610f181496;p=php Forgot to set_compare_func in the new array functions, had only tested with older source. --- diff --git a/ext/standard/array.c b/ext/standard/array.c index 72462a245c..9c154dc7b8 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -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; itype != 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; itype != IS_ARRAY) { php_error(E_WARNING, "Argument #%d to array_intersect() is not an array", i+1);