On 8 April 2022 19:34:52 CEST, Craig Francis <cr...@craigfrancis.co.uk> wrote:
>Hi,
>
>I've written a new draft RFC to address the NULL coercion problems:
>
>https://wiki.php.net/rfc/null_coercion_consistency
>
>This is due to the result of the Allow NULL quiz:
>
>https://quiz.craigfrancis.co.uk/
>
>14 votes for Fatal Type Errors irrespective of `strict_types=1`;
>13 votes for NULL coercion when not using `strict_types=1`;
>8 votes to update some parameters to allow NULL;
>
>I appreciate some want to force strict type checking on everyone, but I
>want to make sure we have this properly documented, with names, and
>explanations.
>
>Breaking changes should be justified - if they aren't, they only
>make upgrading difficult and frustrating (bad for security).
>
>Craig

Hello,

While the RFC extensively documents the problem space, it's rather short on what
exactly it proposes.

In particular, does this propose changing user-defined functions under
strict_types=0 to accept null for scalar types?

Eg., this will be allowed (under strict_types=0):
```
function x(string $y, int $z) {
  ...
}
x(null, null); //no error, no warning
```

Regards,
Mel

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

Reply via email to