#12572 [Opn]: sort() doesn't reindex 1 element arrays at 0
| From: | adam at trachtenberg dot com | Date: | Sat, 17 Aug 2002 06:39:06 +0000 |
| Subject: | #12572 [Opn]: sort() doesn't reindex 1 element arrays at 0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-17109@lists.php.net to get a copy of this message | ||
ID: 12572
User updated by: adam@trachtenberg.com
Reported By: adam@trachtenberg.com
Status: Open
Bug Type: Scripting Engine problem
Operating System: Redhat Linux 7.3
PHP Version: 4.2.2
New Comment:
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);
Previous Comments:
------------------------------------------------------------------------
[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.
------------------------------------------------------------------------
[2002-08-13 23:45:45] kalowsky@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version 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.
Thank you for the report, and for helping us make PHP better.
I believe rodif_bl fixed this in the current CVS. Give it a try if you
can.
------------------------------------------------------------------------
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