#12572 [Opn->Csd]: sort() doesn't reindex 1 element arrays at 0

From: Date: Sat, 17 Aug 2002 18:51:48 +0000
Subject: #12572 [Opn->Csd]: sort() doesn't reindex 1 element arrays at 0
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17140@lists.php.net to get a copy of this message
ID: 12572 Updated by: sniper@php.net Reported By: adam@trachtenberg.com -Status: Open +Status: Closed Bug Type: Scripting Engine problem Operating System: Redhat Linux 7.3 PHP Version: 4.2.2 New Comment: This bug has been fixed in CVS. In case this was a PHP problem, snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. In case this was a documentation problem, the fix will show up soon at http://www.php.net/manual/. In case this was a PHP.net website problem, the change will show up on the PHP.net site and on the mirror sites in short time. Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2002-08-17 02:39:06] adam@trachtenberg.com Okay. I will propose a slightly less complicated patch: Index: zend_hash.c =================================================================== RCS file: /repository/Zend/zend_hash.c,v retrieving revision 1.86 diff -u -u -r1.86 zend_hash.c --- zend_hash.c 1 Aug 2002 16:03:21 -0000 1.86 +++ zend_hash.c 17 Aug 2002 06:38:14 -0000 @@ -1115,7 +1115,7 @@ IS_CONSISTENT(ht); - if (ht->nNumOfElements <= 1) { /* Doesn't require sorting */ + if (ht->nNumOfElements < 1) { /* Doesn't require sorting */ return SUCCESS; } arTmp = (Bucket **) pemalloc(ht->nNumOfElements * sizeof(Bucket *), ht->persistent); ------------------------------------------------------------------------ [2002-08-17 02:09:25] kalowsky@php.net adam you may want to throw this patch out onto phpdev for comments/inclusion options. ------------------------------------------------------------------------ [2002-08-14 11:44:37] adam@trachtenberg.com Updating OS; I'm now running RH 7.3 ------------------------------------------------------------------------ [2002-08-14 09:22:04] kalowsky@php.net Updating the version ------------------------------------------------------------------------ [2002-08-14 01:17:46] adam@trachtenberg.com I just tested it with the latest CVS and it still happens. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/12572 -- Edit this bug report at http://bugs.php.net/?id=12572&edit=1

« previous php.bugs (#17140) next »