On Tue, Jul 15, 2014 at 5:13 AM, Andrea Faulds <a...@ajf.me> wrote: > > On 15 Jul 2014, at 06:50, Kris Craig <kris.cr...@gmail.com> wrote: > > > While a practical argument can certainly be made that existing solutions > 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 if > an operator would be a better approach. Some languages I've seen that use > / as the division operator will use a \ as the integer division operator. > > We use \ for namespaces, and Python 3’s // obviously can’t be used, so I > might suggest Pascal’s div operator: >
Oh, derp. On Wed, Jul 16, 2014 at 5:11 PM, Bishop Bettini <bis...@php.net> wrote: > As another contender, how about: > > $x = 242 %/ 7; > $x %/= 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