
You should be fine by not hitting them, but like if you do some maths computation with it, you might hit like the boundaries, or you do like very edge cases where you try to like mess up with PHP, like that so it's something which you can do it. On 32 bit, which I would imagine most people don't use any more, is a very just like minus 2 billion to 2 billion, because PHP integers are signed, and on 64 bits, it's like nine quintillion? Derick Rethans 3:15 And you say, fits in the integer range, what ranges are we talking about here? George Peter Banyard 3:01 Derick Rethans 2:54Īnd that currently doesn't happen yet. But if you do 15.5, then you'll get like a, like a deprecation notice which will tell you it's like, well, here's the key gets implicitly converted, you should be aware of this because if you use 15 somewhere else, you'd be overriding the value. So if you use 15.0 as an array key, it gets converted to 15, you'll get don't get any error because it's like well it's just 15 like it doesn't mind. If the floating point number, is considered an integer because it only has like decimal zeros, and it fits in the integer range, then you'll have like no error. If you use a floating point number, were you should be using an integer.

It builds up on top on the saner numeric string RFC, because it tries to like make the whole numericness of PHP, as a concept better and like less error prone, but in essence it's mostly self contained. Is there any prior work that is RFC is building on top of George Peter Banyard 2:03 These are specific features of floating point numbers on computers? George Peter Banyard 1:59 For example, they can have a fractional part, or they can be infinity, or not a number if you divide, like infinity by infinity, or 0 over 0 or other things like that. Although floats, don't usually fit in integer will have like extra data which can't be represented as an integer. But one last standing issue is that floats will pass an integer check, without any notices or warnings. And most type conversions are relatively sane now in PHP 8, because like numeric strings have been kind of fixed. What is the problem that this RFC is trying to solve, or rather, what's the change that is in this RFC is trying to solve? George Peter Banyard 1:11Ĭurrently in PHP, which is a dynamic language, types are not known at the statically at compile time, so it's so everything's mostly runtime.

That is a lovely small title you have come up with. This one is titled deprecate implicit non integer compatible floats to int conversions. Following on for from other numeric RFCs, so to speak. I was just talking to Larry Garfield, and he was wondering whether you or himself, are the second often guests on this podcast, but I haven't run a stats.
DOODLE FIT INTEGER PROBLEM FREE
Hello, my name is George and I work on PHP in my free time. Today I'm talking with George Peter Banyard, about another tidying up RFC, George, would you please introduce yourself? George Peter Banyard 0:31 Welcome to PHP internals news, a podcast dedicated to explaining the latest developments in the PHP language.
