Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-06 Thread David Gebler
This is all a bit moot anyway, the RFC proposal is for warnings or notices on implicit casts only. I'm not a voting member for RFCs so my opinion is mere food for thought, nonetheless my two cents is that: a) The proposal relies on a premise that an implicit cast of (non-zero fractional) float to

Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-06 Thread Rowan Tommins
On 06/02/2021 14:47, Christian Schneider wrote: 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.

[PHP-DEV] Re: [RFC] Global functions any() and all() on iterables

2021-02-06 Thread tyson andre
Hi internals, > I've created an RFC for https://wiki.php.net/rfc/any_all_on_iterable > > This was proposed 2 days ago in https://externals.io/message/111711 with some > interest > ("Proposal: Adding functions any(iterable $input, ?callable $cb = null, int > $use_flags=0) and all(...)") > > - Th

Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-06 Thread Christian Schneider
Am 06.02.2021 um 01:17 schrieb Benjamin Morel : > 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 t

Re: [PHP-DEV] [RFC] Warning for implicit float to int conversions

2021-02-06 Thread Rowan Tommins
On 5 February 2021 23:45:59 GMT, David Gebler wrote: >I still think a warning is too high an error level for this and would >favour a notice or deprecation, were it to be done at all. I'd just like to point out that a deprecation notice implies (or should imply!) that the behaviour will be comp