Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75630 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96964 invoked from network); 17 Jul 2014 03:02:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2014 03:02:27 -0000 Authentication-Results: pb1.pair.com header.from=kris.craig@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=kris.craig@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.223.177 as permitted sender) X-PHP-List-Original-Sender: kris.craig@gmail.com X-Host-Fingerprint: 209.85.223.177 mail-ie0-f177.google.com Received: from [209.85.223.177] ([209.85.223.177:53546] helo=mail-ie0-f177.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 6A/B1-19007-2CC37C35 for ; Wed, 16 Jul 2014 23:02:27 -0400 Received: by mail-ie0-f177.google.com with SMTP id at20so1967481iec.36 for ; Wed, 16 Jul 2014 20:02:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=kH6oTM1M7KFzhSDfxwZzAPjDOV053zQiyMnMbHfi598=; b=IrkrcQ+c+dYyHBqPNFHxy8KgVkZ8A3qAwTtyvuDPR5yjFgpA0nIYjTJeftmFJhVgU4 Swuwe5eGagUSveyBi/OvdeWjZtPTniqJYCz3pBu7RTkSUY1jRluEwuchJzyrf+EG5ZgA 6Ne9JWII2ACGOgASjyRzzMNHLilV9lSmN/MIXKcheZXwQWr5SP4HbTxZYrmmhqFumJsH q27BrdghhrGVeJ5DuTeRj8xIuzG8PwDuOYRZAZmO3am9l7bmL1x7F1sNx3wUIGwgLUJH qAcCzs8++clp9tzSHOFQ0YFZjLW/h8Ldj8YjsuyHNhFuILZNzukB0EC4moYvlLOCqfHx 5V+A== MIME-Version: 1.0 X-Received: by 10.60.133.233 with SMTP id pf9mr40764443oeb.30.1405566142256; Wed, 16 Jul 2014 20:02:22 -0700 (PDT) Received: by 10.202.15.72 with HTTP; Wed, 16 Jul 2014 20:02:22 -0700 (PDT) In-Reply-To: References: <7646A8D1-69A2-4255-B048-D3B9F28B422F@ajf.me> <53C47CA2.4050306@sugarcrm.com> <714C2E5E-A321-4993-9CFB-F7DFAC45C532@ajf.me> <53C4B955.5060401@sugarcrm.com> Date: Wed, 16 Jul 2014 20:02:22 -0700 Message-ID: To: Andrea Faulds Cc: Stas Malyshev , PHP internals Content-Type: multipart/alternative; boundary=047d7b4720789e1aea04fe5ade43 Subject: Re: [PHP-DEV] [RFC] intdiv() From: kris.craig@gmail.com (Kris Craig) --047d7b4720789e1aea04fe5ade43 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Tue, Jul 15, 2014 at 5:13 AM, Andrea Faulds wrote: > > On 15 Jul 2014, at 06:50, Kris Craig wrote: > > > While a practical argument can certainly be made that existing solution= s > can fit the examples OP cited, I don't think that takes away from the > underlying principle of the argument: That there's no reason *not* to > include a basic integer division in PHP. It's never made sense to me why > it wasn't included. Rather than an intdiv() function, though, I wonder i= f > an operator would be a better approach. Some languages I've seen that us= e > / as the division operator will use a \ as the integer division operator. > > We use \ for namespaces, and Python 3=E2=80=99s // obviously can=E2=80=99= t be used, so I > might suggest Pascal=E2=80=99s div operator: > Oh, derp. On Wed, Jul 16, 2014 at 5:11 PM, Bishop Bettini wrote: > As another contender, how about: > > $x =3D 242 %/ 7; > $x %/=3D 13; > I like this idea! I haven't seen anyone else respond to it yet, though. My only question would be whether %/ or /% would be more appropriate. Perhaps the RFC could have two options for approval; one with %% and the other with either %/ or /%. Thoughts? --Kris --047d7b4720789e1aea04fe5ade43--