Re: [PHP4BETA] (Fwd) Re: [PHP4BETA] cvs: /php4 ChangeLog /php4/ext/standard basic_functions.c basic_functions.h
| From: | Thies C. Arntzen | Date: | Fri, 08 Oct 1999 06:03:05 +0000 |
| Subject: | Re: [PHP4BETA] (Fwd) Re: [PHP4BETA] cvs: /php4 ChangeLog /php4/ext/standard basic_functions.c basic_functions.h | ||
| References: | 1 | Groups: | php.version4 |
| Request: | Send a blank email to php-version4+get-5366@lists.php.net to get a copy of this message | ||
i think having our own qsort could be good - does autoconf have a macro
HAVE_BROKEN_QSORT;-)
but then it's up to zeev and andi if they want to put it into libzend
(which i doubt they will - and i understand the reasons) -
so i would say we'd just create a special case for shuffle.
so i like #3, but could live with #2!
tc
On Thu, 7 Oct 1999, Andrei Zmievski wrote:
> 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. *
>
> --
> PHP 4 Beta
>
>
Thies C. Arntzen "One Big-Mac, Small Fries and a Coke!"
Digital Collections Phone +49 40 235350 Fax +49 40 23535180
Hammerbrookstr. 93 20097 Hamburg / Germany