Re: [PHP-DEV] NULL Coercion Consistency

2022-04-20 Thread Andreas Leathley
On 14.04.22 14:14, Craig Francis wrote: Yep, I agree with everything you have said there, and it's what George seems to be working towards (which I also agree with): https://github.com/Girgias/unify-typing-modes-rfc Yet your RFC goes exactly against the quoted document by making the difference

Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throwa deprecation notice ?

2022-04-20 Thread Claude Pache
> Le 20 avr. 2022 à 12:42, Rowan Tommins a écrit : > > > The situation with is_callable is a bit less clear, because it depends on how > the function is actually being used. If a false return is eventually > equivalent to some kind of error, then the behaviour would ideally match > callabl

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-20 Thread Craig Francis
On Wed, 20 Apr 2022 at 18:26, Christoph M. Becker wrote: > Null is *not* a scalar type[1], though. This is the reason why it is > not coerced for userland functions using *scalar* type hints with > coercive typing. > > [1] > But why not? and how many developers

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-20 Thread Christoph M. Becker
On 20.04.2022 at 19:02, Craig Francis wrote: > In contrast, failing early at runtime, on something that is not actually a > problem, like the examples in my RFC, creates 2 problems (primarily > upgrading; but also adding unnecessary code to explicitly cast those > possible NULL values to the corre

Re: [PHP-DEV] NULL Coercion Consistency

2022-04-20 Thread Craig Francis
On Tue, 19 Apr 2022 at 14:17, Rowan Tommins wrote: > On 19/04/2022 12:34, Craig Francis wrote: > > The developers I work with would assume the last definition > > > I think you've somewhat missed my point. I wasn't talking about people's > habits or preferences, I was talking about different *sce

Re: [PHP-DEV] [RFC] Add true as type

2022-04-20 Thread G. P. B.
Hello internals, I've expanded on the RFC: https://wiki.php.net/rfc/true-type Please let me know if there are still aspects which need clarification. I will also say that I think enums are far superior to literal types, but only having false and not true is extremely weird to me (and in a pure t

Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throwa deprecation notice ?

2022-04-20 Thread Rowan Tommins
On 20/04/2022 08:33, Claude Pache wrote: Expanding my last message: Although we can technically use deprecation warning for anything reasonable (even without precedent), we should nevertheless be careful that it remains possible to write forward- and backward-compatible code without triggering

Re: [PHP-DEV] Deprecated partially supported callables: should is_callable() throwa deprecation notice ?

2022-04-20 Thread Claude Pache
> Le 20 avr. 2022 à 00:22, Claude Pache a écrit : > > > >> Le 19 avr. 2022 à 20:20, Andreas Hennings a écrit : >> >> A deprecation warning on is_callable() would imply that in a future >> version of PHP that call will be illegal. > > No, in the case of `is_callable()`, the deprecation wa