Am 06.02.2021 um 01:17 schrieb Benjamin Morel <benjamin.mo...@gmail.com>:
> Could we at least fix the odd cases where the cast is definitely a failure?
> Like:
> 
> (int) 1e60; // 0
> (int) "foo"; // 0


Are you talking about the constant values 1e60 and "foo"? If not then please 
don't add a warning (or worse).

I'm sure there is a lot of code which takes user input and uses (int) casts to 
ensure they are dealing with integers.
There is also intval() as an alternative but my guess would be that real world 
code uses 50% (int) and 50% intval() to do this.

This would be a big BC break IMHO.

- Chris

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: https://www.php.net/unsub.php

Reply via email to