Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:11651 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 79152 invoked by uid 1010); 30 Jul 2004 06:43:24 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 79093 invoked from network); 30 Jul 2004 06:43:23 -0000 Received: from unknown (HELO mail.zend.com) (80.74.107.235) by pb1.pair.com with SMTP; 30 Jul 2004 06:43:23 -0000 Received: (qmail 29542 invoked from network); 30 Jul 2004 06:43:21 -0000 Received: from localhost (HELO AndiNotebook.zend.com) (127.0.0.1) by localhost with SMTP; 30 Jul 2004 06:43:21 -0000 Message-ID: <5.1.0.14.2.20040729232013.02f38418@127.0.0.1> X-Sender: andi@127.0.0.1 X-Mailer: QUALCOMM Windows Eudora Version 5.1 Date: Thu, 29 Jul 2004 23:20:46 -0700 To: Marcus Boerger ,John Coggeshall Cc: internals@lists.php.net,John Coggeshall In-Reply-To: <768086459.20040727214559@marcus-boerger.de> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; format=flowed Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] Sorting Bug / Wrong behavior? From: andi@zend.com (Andi Gutmans) I talked to John about this yesterday. I'll take a closer look at this=20 within the coming days to see if this makes sense and how it affects BC in= =20 general (if at all). At 09:45 PM 7/27/2004 +0200, Marcus Boerger wrote: >Hello John, > >Tuesday, July 27, 2004, 9:48:28 PM, you wrote: > > > > Consider the following: > > > 0, 'b'=3D>1, 'c'=3D>2); > > sort($a); > > print_r($a); >?>> > > > This produces a bogus output: > > > Array > > ( > > [0] =3D> a > > [1] =3D> b > > [2] =3D> 0 > > [3] =3D> c > > [4] =3D> 1 > > [5] =3D> 2 > > ) > > > > Notice how 0 and c are switched incorrectly. Attached is a patch to > > zend_operators.c that fixes it. > > >The current order simply makes no sense at all.=B4The following though= would: >0 a b c 1 2 // zero dirst, then strings then numbers >a b c 0 1 2 // strings first, then numbers >0 1 2 a b c // numbers first, then strings > >and btw, john you forgot the patch, it is attached here. >The one provided does the 2nd which means we only ensured >0 is treated un the same way other numbers are. > >Best regards, > Marcus mailto:helly@php.net >-- >PHP Internals - PHP Runtime Development Mailing List >To unsubscribe, visit: http://www.php.net/unsub.php