From: Ilia Alshanetsky Date: Sat, 9 Aug 2003 20:50:25 +0000 (+0000) Subject: MFH: Fixed bug #24897 (inconsistent behavior of shuffle() & X-Git-Tag: php-4.3.3RC4~62 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b74daafbcd158694757427b5068bae877b656e7a;p=php MFH: Fixed bug #24897 (inconsistent behavior of shuffle() & array_multisort()) --- diff --git a/NEWS b/NEWS index 7d7aa39a3a..ffa5426018 100644 --- 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) diff --git a/ext/standard/array.c b/ext/standard/array.c index 0e2b8843e8..d9da22669e 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -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);