Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:75629 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 91998 invoked from network); 17 Jul 2014 02:41:39 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jul 2014 02:41:39 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.220.46 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.220.46 mail-pa0-f46.google.com Received: from [209.85.220.46] ([209.85.220.46:60594] helo=mail-pa0-f46.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 50/61-19007-1E737C35 for ; Wed, 16 Jul 2014 22:41:38 -0400 Received: by mail-pa0-f46.google.com with SMTP id lj1so2404616pab.19 for ; Wed, 16 Jul 2014 19:41:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=vlsc4S+hq49/oKz578YP7UR8wPjjiFAE/j9lOme9+l8=; b=TcSU1gPAIUuQ3RJJWLYzlfZDNqe5/O6tCiRGE3vi/2mBazf5nvDkrOe1uO1ullFuzZ Q05xnBUkhGqlxgJPaewzi+Ly3LSP1L3DfVBnzWFzyorCdRyS6lEf2vyKNn/cWWgeUW6r TJg2lsZED/fv4uVoyATWZdDziYCFHdSq5XmlwBLq5Jz2+KLYsbeDZREG1impT6NgKxqh 1HjW1Qyffe72nzVp6V6xjUexFml+jakoXmodXK4Lp1S6YqqiyNMtGnjPafyDINuVtwjP s6yuZ4vMNwCDl1vLNH0gPJRkLFkvYlYbjBAKcbm5Akr1j0q4GAiJZvd7AtW7m9M8N7Zn GqpA== X-Gm-Message-State: ALoCoQmb8tagWttUuhoNahebKHw4TBmqCYDmA2IHTPc9KVBLtsTNw0EdfChg/cc91E45C5k5z/zH MIME-Version: 1.0 X-Received: by 10.70.94.201 with SMTP id de9mr20460352pdb.116.1405564894111; Wed, 16 Jul 2014 19:41:34 -0700 (PDT) Sender: php@golemon.com Received: by 10.70.21.35 with HTTP; Wed, 16 Jul 2014 19:41:33 -0700 (PDT) X-Originating-IP: [71.198.113.183] In-Reply-To: <1240076591.91249.1405564441970.open-xchange@app1.ox.registrar-servers.com> References: <1240076591.91249.1405564441970.open-xchange@app1.ox.registrar-servers.com> Date: Wed, 16 Jul 2014 19:41:33 -0700 X-Google-Sender-Auth: BCLfMacuQ26MmO3fNi_o17Zj9S4 Message-ID: To: Andrea Faulds Cc: Tjerk Meesters , bishop@php.net, PHP internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] intdiv() From: pollita@php.net (Sara Golemon) On Wed, Jul 16, 2014 at 7:34 PM, Andrea Faulds wrote: > What are you suggesting you do for an integer division, then? ($a - ($a % $b)) / > $ b? The division operator already returns an integer. Or should I just use > intdiv()? > It does, but it returns the float truncated result of division. I'm suggesting having it to integer division. So you'd do: $a / $b and it's be smart enough to do the right method. >> If we're really set on adding a new operator, I'd vote for something >> which provides dividend *and* remainder in some way. (Useful for time >> arithmetic, for example) >> In all seriousness, you could just have the compiler optimise using % and %% > successively with the same operands to just be a single division, if that's > possible. > Assuming you meant / and %, then probably in opcache+'s optimizer. -Sara