Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:81717 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 15369 invoked from network); 3 Feb 2015 14:49:34 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 3 Feb 2015 14:49:34 -0000 Authentication-Results: pb1.pair.com header.from=ajf@ajf.me; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=ajf@ajf.me; spf=pass; 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:60707] helo=imap2-3.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 5D/CF-20608-CFFD0D45 for ; Tue, 03 Feb 2015 09:49:34 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 65DC68C0080; Tue, 3 Feb 2015 09:49:30 -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 zDR5WF_rMGaq; Tue, 3 Feb 2015 09:49:30 -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 ACD778C0057; Tue, 3 Feb 2015 09:49:29 -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 14:49:27 +0000 Cc: internals@lists.php.net Content-Transfer-Encoding: quoted-printable Message-ID: <3B265E0A-7479-456A-B134-5CA607C68EFF@ajf.me> References: <1D8DC03D-0E2C-494C-9ED2-244334F57D8A@ajf.me> <6E8210CD-4BA3-4694-8482-4803F562D77C@ajf.me> <1BEEF374-D8BC-4FE2-8CE0-5EBB1AC4CF04@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) Hi, > On 3 Feb 2015, at 14:43, Leigh wrote: >=20 > On 3 February 2015 at 14:36, Andrea Faulds wrote: >> I don=E2=80=99t know where you got that idea. The binary ops are = consistent - they aren=E2=80=99t constrained by register size like in = previous PHP versions, but they=E2=80=99re still completely consistent. >>=20 >=20 > php -r 'var_dump(1 << 65);' > int(2) >=20 > Rotate left gets broken. 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. If = you want to =E2=80=9Crotate left=E2=80=9D, bitmasking does exist. >=20 >> It=E2=80=99s slower, yes, but that hardly matters. If people care so = much about performance, why use PHP? >>=20 >=20 > If people didn't care about performance, we wouldn't have phpng, or > any of the other work people have done to make the engine faster. >=20 > Sometimes you have to make the most of what you have available. OK, performance is not unimportant. But in most cases, = arbitrary-precision integers are not going to be a bottleneck for your = web app. 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. -- Andrea Faulds http://ajf.me/