Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81171 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 27088 invoked from network); 26 Jan 2015 19:19:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Jan 2015 19:19:34 -0000 Authentication-Results: pb1.pair.com header.from=rasmus@lerdorf.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=rasmus@lerdorf.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain lerdorf.com designates 209.85.192.45 as permitted sender) X-PHP-List-Original-Sender: rasmus@lerdorf.com X-Host-Fingerprint: 209.85.192.45 mail-qg0-f45.google.com Received: from [209.85.192.45] ([209.85.192.45:53964] helo=mail-qg0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id C6/50-25415-54396C45 for ; Mon, 26 Jan 2015 14:19:34 -0500 Received: by mail-qg0-f45.google.com with SMTP id q107so8414489qgd.4 for ; Mon, 26 Jan 2015 11:19:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to:content-type; bh=dtRuLbkmy2SsFZR8iN2t1F3nnNE9IGx8If9SlgFQLeI=; b=Yc+w6Yfev2Yr7r7FKtBIobmKaTDo5cDVBquogq/1TUqwqLjTy/8kVqluQC1cUeF4az Aku9ysG5pTkNfvbouwRvrME/7/XAfceYrwaocibjRqAzSPRdnKhj2NUUidxMUNN3aK/N RMSiwZV2v18WIgM1PfaNcEtkKe3aKcV7xUfibSRQQtOpo8youPc5Dym+1am//9P5FEG3 71vnvHOkci+jo6LKOmluwYb67oBnU3ZTaDc1OpuOtVTEF1OrYjBt36jhfnIQ8bGMvWXm G/CCAI+pEEVZVDyjIKJxRAr0tl6baq81z4lPRCpWWsai4Ulxbp8SuxpmV5k88Idn686W zsuw== X-Gm-Message-State: ALoCoQnXud7ZB1UAYt9vycnQAcvjWl+dlUZsuP6oqDULktUGMxzT6pzYdy8GWjVMDidMLpAZNWFX X-Received: by 10.140.21.48 with SMTP id 45mr42123993qgk.87.1422299970569; Mon, 26 Jan 2015 11:19:30 -0800 (PST) Received: from [192.168.200.14] (c-50-131-44-225.hsd1.ca.comcast.net. [50.131.44.225]) by mx.google.com with ESMTPSA id j2sm6016871qai.34.2015.01.26.11.19.28 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Jan 2015 11:19:29 -0800 (PST) Message-ID: <54C6933F.9020808@lerdorf.com> Date: Mon, 26 Jan 2015 11:19:27 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Pascal Chevrel , internals@lists.php.net References: In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="w2HqHXIjMd68pqgMUSnAKbwr9B8e2WGLM" Subject: Re: [PHP-DEV] Dort behaviour change on php7 master From: rasmus@lerdorf.com (Rasmus Lerdorf) --w2HqHXIjMd68pqgMUSnAKbwr9B8e2WGLM Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: quoted-printable On 01/26/2015 11:14 AM, Pascal Chevrel wrote: > Hi all, >=20 > I just compiled master to test my main application and the good news is= > that I have no functional regression and some of the views get a > considerable speed up (like, page generation divided by two!). >=20 > I had one unit test failing and I reduced that to a simple testcase tha= t > I put there: >=20 > http://3v4l.org/4tGv6 >=20 > Sorting in php master in this specific case is now different on PHP 7 > than on 5.3-5.6 (and actually different than PHP 7 at the beginning of > the month). The sorting order is now the same as HHVM. >=20 > I think the HHVM behaviour makes more sense in this case as I don't see= > why the resulting array should be reversed in this sorting case where > all lengths are equal, but on the other hand the current behaviour is > probably 10 years old and maybe it could cause bigger problems in other= > apps than a unit test to update. >=20 > Just that you know, in case it matters. Yeah, this is a known change and the documentation has had a note about not relying on the ordering of equal elements. Although the note in the manual is probably a bit too geeky. It should be more explicit and talk about the effect rather than the cause: Note: Like most PHP sorting functions, sort() uses an implementation of =BB Quicksort. The pivot is chosen in the middle of the partition resulting in an optimal time for already sorted arrays. This is however an implementation detail you shouldn't rely on. -Rasmus --w2HqHXIjMd68pqgMUSnAKbwr9B8e2WGLM Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAlTGkz8ACgkQlxayKTuqOuCDuACfeSOy6C30+lu3Az/FmLlfWQF/ z8AAn10xa72ggk+Ie8rrK2aueCnkVfq+ =b7gB -----END PGP SIGNATURE----- --w2HqHXIjMd68pqgMUSnAKbwr9B8e2WGLM--