Hi, > On 3 Feb 2015, at 14:43, Leigh <lei...@gmail.com> wrote: > > On 3 February 2015 at 14:36, Andrea Faulds <a...@ajf.me> wrote: >> I don’t know where you got that idea. The binary ops are consistent - they >> aren’t constrained by register size like in previous PHP versions, but >> they’re still completely consistent. >> > > php -r 'var_dump(1 << 65);' > int(2) > > Rotate left gets broken.
It’s not “broken”, the behaviour is just different to account for it now being an arbitrary-precision type. If you want to “rotate left”, bitmasking does exist. > >> It’s slower, yes, but that hardly matters. If people care so much about >> performance, why use PHP? >> > > If people didn't care about performance, we wouldn't have phpng, or > any of the other work people have done to make the engine faster. > > Sometimes you have to make the most of what you have available. OK, performance is not unimportant. But in most cases, arbitrary-precision integers are not going to be a bottleneck for your web app. Also, the bigint changes only affect you if you’re dealing with large integers anyway. If you want to preserve the horrid float promotion behaviour, you can do so explicitly. But I think in most cases, it’s better to trade off performance for lack of data loss. -- Andrea Faulds http://ajf.me/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php