]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #24897 (inconsistent behavior of shuffle() &
authorIlia Alshanetsky <iliaa@php.net>
Sat, 9 Aug 2003 20:50:25 +0000 (20:50 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 9 Aug 2003 20:50:25 +0000 (20:50 +0000)
array_multisort())

NEWS
ext/standard/array.c

diff --git a/NEWS b/NEWS
index 7d7aa39a3a8ab65a7f146e054bf711a56b064102..ffa54260184cd1fcc6ae76ded40c2a11872e735b 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,8 @@ PHP 4                                                                      NEWS
 - Fixed bug #24977 (Revert mysql_select_db optimization). (Ilia)
 - Fixed bug #24909 (Bad random numbers with ZTS builds on Solaris). (Ilia)
 - Fixed bug #24951 (ob_flush() needlessly destroys output handler). (Ilia)
+- Fixed bug #24897 (inconsistent behavior of shuffle() & array_multisort()).
+  (Ilia, Jani)
 - Fixed bug #24792 (--enable-zend-multibyte causes random segfaults with ZTS).
   (fujimoto)
 - Fixed bug #24142 (workaround for a gcc bug affecting round()). (Marcus, Ilia)
index 0e2b8843e8be6f916ad8c495d956aa35334d758f..d9da22669e25ee20a04e2553a5c5d0c3b7e5ad44 100644 (file)
@@ -1476,7 +1476,7 @@ static void array_data_shuffle(zval *array TSRMLS_DC)
 
        n_elems = zend_hash_num_elements(Z_ARRVAL_P(array));
        
-       if (n_elems <= 1) {
+       if (n_elems < 1) {
                return;
        }
 
@@ -2983,7 +2983,7 @@ PHP_FUNCTION(array_multisort)
 
        /* If all arrays are empty or have only one entry,
           we don't need to do anything. */
-       if (array_size <= 1) {
+       if (array_size < 1) {
                for (k = 0; k < MULTISORT_LAST; k++)
                        efree(ARRAYG(multisort_flags)[k]);
                efree(arrays);