Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81719 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 19676 invoked from network); 3 Feb 2015 15:02:20 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2015 15:02:20 -0000 Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Received-SPF: pass (pb1.pair.com: domain ajf.me designates 192.64.116.208 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.208 imap2-3.ox.privateemail.com Received: from [192.64.116.208] ([192.64.116.208:49554] helo=imap2-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CE/B0-20608-BF2E0D45 for ; Tue, 03 Feb 2015 10:02:20 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 5B2F18C0069; Tue, 3 Feb 2015 10:02:17 -0500 (EST) X-Virus-Scanned: Debian amavisd-new at imap2.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap2.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id vInVhd6v4e8Y; Tue, 3 Feb 2015 10:02:17 -0500 (EST) Received: from oa-res-26-240.wireless.abdn.ac.uk (oa-res-26-240.wireless.abdn.ac.uk [137.50.26.240]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id B5EFE8C0080; Tue, 3 Feb 2015 10:02:16 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 8.2 \(2070.6\)) In-Reply-To: Date: Tue, 3 Feb 2015 15:02:14 +0000 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <1470D29A-2D95-4E03-BEBC-CE1D9AD2FB16@ajf.me> References: <1D8DC03D-0E2C-494C-9ED2-244334F57D8A@ajf.me> <6E8210CD-4BA3-4694-8482-4803F562D77C@ajf.me> <1BEEF374-D8BC-4FE2-8CE0-5EBB1AC4CF04@ajf.me> <3B265E0A-7479-456A-B134-5CA607C68EFF@ajf.me> To: Leigh X-Mailer: Apple Mail (2.2070.6) Subject: Re: [PHP-DEV] Zero-fill right shift. From: ajf@ajf.me (Andrea Faulds) > On 3 Feb 2015, at 14:59, Leigh wrote: >=20 > On 3 February 2015 at 14:49, Andrea Faulds wrote: >> It=E2=80=99s not =E2=80=9Cbroken=E2=80=9D, the behaviour is just = different to account for it now being an arbitrary-precision type. >>=20 >=20 > That's pretty much the definition of a BC issue. Sure, it=E2=80=99s a BC break if you=E2=80=99re relying on the undefined = behaviour of your platform. Which a lot of people unfortunately were = doing. Actually, this specific case was already broken in PHP 7 after the = Integer Semantics RFC passed, which made our bitwise shifts more = consistent across platforms. >> Also, the bigint changes only affect you if you=E2=80=99re dealing = with large integers anyway. If you want to preserve the horrid float = promotion behaviour, you can do so explicitly. But I think in most = cases, it=E2=80=99s better to trade off performance for lack of data = loss. >>=20 >=20 > It's not anything to do with float promotion or data loss. If I'm > working with a 64-bit bitmask that gets promoted to bigint when I set > the high bit Why would it be promoted?! The high bit is the 63rd bit. It fits within = a long. -- Andrea Faulds http://ajf.me/