Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75593 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 13823 invoked from network); 16 Jul 2014 15:15:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Jul 2014 15:15:23 -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.199 as permitted sender) X-PHP-List-Original-Sender: ajf@ajf.me X-Host-Fingerprint: 192.64.116.199 imap11-2.ox.privateemail.com Received: from [192.64.116.199] ([192.64.116.199:35911] helo=imap11-2.ox.privateemail.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D9/82-31820-90796C35 for ; Wed, 16 Jul 2014 11:15:22 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.privateemail.com (Postfix) with ESMTP id 32DC88800DB; Wed, 16 Jul 2014 11:15:19 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at imap11.ox.privateemail.com Received: from mail.privateemail.com ([127.0.0.1]) by localhost (imap11.ox.privateemail.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id bpcFG3aRLbUf; Wed, 16 Jul 2014 11:15:19 -0400 (EDT) Received: from [192.168.0.15] (unknown [90.210.122.167]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.privateemail.com (Postfix) with ESMTPSA id 178C28800D0; Wed, 16 Jul 2014 11:15:17 -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: Wed, 16 Jul 2014 16:15:12 +0100 Cc: PHP internals Content-Transfer-Encoding: quoted-printable Message-ID: <37F89E54-C5B9-4E81-9D1B-660190BDB1FF@ajf.me> References: <7646A8D1-69A2-4255-B048-D3B9F28B422F@ajf.me> To: bishop@php.net X-Mailer: Apple Mail (2.1878.6) Subject: Re: [PHP-DEV] [RFC] intdiv() From: ajf@ajf.me (Andrea Faulds) On 16 Jul 2014, at 02:51, Bishop Bettini wrote: > TL;DR -- I agree with the principal but want implemented as the infix > operator %% with a test for PHP_INT_MIN %% -1 =3D=3D=3D false (and a = E_WARNING). The RFC has been updated to v0.2. It now proposes a %% operator for = integer division (with corresponding %%=3D assignment operator). = However, it returns 0 for the PHP_INT_MIN overflow case like %, rather = than FALSE and an E_WARNING. The original intdiv() proposal is kept as a fallback; two votes will be = held simultaneously, one 2/3 vote for the %% operator and a 50%+1 for = the intdiv() function. If the first fails, then if the second did not, = the intdiv() function is implemented instead. This way we=92ll still at = least have a way to do integer division in PHP, if not a full operator. Nikita Popov doesn=92t seem to be a fan of the %% syntax, so it may be = subject to change, though I think it=92s the best I=92ve heard so far. = ;) -- Andrea Faulds http://ajf.me/