Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77244 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 62907 invoked from network); 16 Sep 2014 12:36:49 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Sep 2014 12:36:49 -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.200 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.200 imap1-2.ox.privateemail.com Received: from [192.64.116.200] ([192.64.116.200:59853] helo=imap1-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 39/DD-64534-FDE28145 for ; Tue, 16 Sep 2014 08:36:48 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 48D5FB00092; Tue, 16 Sep 2014 08:36:44 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap1.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap1.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 99CjrA8H182P; Tue, 16 Sep 2014 08:36:44 -0400 (EDT) Received: from oa-res-27-90.wireless.abdn.ac.uk (oa-res-27-90.wireless.abdn.ac.uk [137.50.27.90]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id EC763B0008E; Tue, 16 Sep 2014 08:36:41 -0400 (EDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) In-Reply-To: Date: Tue, 16 Sep 2014 13:36:37 +0100 Cc: Dmitry Stogov , Levi Morrison , PHP Developers Mailing List Content-Transfer-Encoding: quoted-printable Message-ID: <4095B5EE-310F-4684-A55C-6A2A1B073A29@ajf.me> References: <528B8D9E-58FF-47DD-9B91-013F8844EC70@ajf.me> <93C6A290-493F-42B3-824B-AE81ACCDBA61@ajf.me> To: Chris Wright X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [VOTE][RFC] Integer Semantics From: ajf@ajf.me (Andrea Faulds) On 16 Sep 2014, at 11:19, Chris Wright wrote: > On 16 September 2014 11:05, Dmitry Stogov wrote: >> you already made silent break for N << 64 and N >> 64, but it may be >> explained as more consistent behaviour. >> I don't see a big difference with negative shifts. >>=20 >> The real thing that I don't like - is a "boolean" result. Warning is = not a >> big problem. >=20 > I'm inclined to agree with this. The warning makes sense as it's > almost certainly a userland bug, and if the expected old behaviour is > desired it can easily be modified in userland, but returning FALSE > doesn't make a huge amount of sense. This will almost certainly be > immediately cast to int(0) by the next operation - almost no-one is > going to actually check for a return value of FALSE - so it makes more > sense to just return 0 and avoid the implicit cast. This would also > produce possibly-unexpected results if a future operation was to > stringify the result, as FALSE would cast to the empty string. >=20 > I have voted in favour of the RFC as it stands as I believe that > overall the changes are positive, but ideally this particular case > would be addressed. The choice of bool(false) was due to precedent. This is what we do for a = division by zero. I agree that some other value would make more sense, = but I couldn=92t think of a better one, so I just stuck with the = existing behaviour for div0. -- Andrea Faulds http://ajf.me/