(Fwd) Re: [PHP4BETA] cvs: /php4 ChangeLog /php4/ext/standard basic_functions.c basic_functions.h

From: Date: Thu, 07 Oct 1999 22:06:29 +0000
Subject: (Fwd) Re: [PHP4BETA] cvs: /php4 ChangeLog /php4/ext/standard basic_functions.c basic_functions.h
Groups: php.version4 
Request: Send a blank email to php-version4+get-5353@lists.php.net to get a copy of this message
So, what're we doing about this issue? It does need to be resolved. Basically glibc qsort() doesn't break because it's really a merge sort. Copy of my previous message: ----------------------------------- Thies C. Arntzen wrote: > On Wed, 6 Oct 1999, Andrei Zmievski wrote: > > > Instead of copying zend_hash_sort, let's just rewrite shuffle() to use > > another algorithm.. > > just go ahead (lets also "backport" to PHP3 to make shuffle() work on > solaris) - Well, I guess the problem isn't in algorithm, but in how to rearrange the contents of the hash. zend_hash_sort() does a lot of things, so there are 3 ways to solve this: 1. Don't use zend_hash_sort() in shuffle(). Instead use regular hash access functions to shuffle hash. This may be slower and also problematic if the array has mixed string and numeric keys. 2. Copy zend_hash_sort() into another function, put the suggested code into it and use it. But then either zend_hash_rehash() will need to be made non-static, or we'll have to copy the code for that as well. 3. Find the source code for non-degenerative qsort() and include it with PHP so that everything uses it. I like #3. -Andrei * I don't mind going nowhere as long as it's an interesting path. * ---End of forwarded mail from <zmievski@ispi.net> ("Andrei Zmievski") -Andrei * George Orwell was an optimist. *

« previous php.version4 (#5353) next »