On Wed, 2 Mar 2022 at 12:26, Dik Takken <dik.tak...@gmail.com> wrote:

> So, to get this crystal clear, this is my understanding of what you are
> proposing for passing null to a non-nullable function parameter
> (hopefully my ASCII art will come through ok):
>
>
> which     | strict_types  | PHP 8.0    | PHP 8.1    | PHP 9
> ----------|---------------|------------|------------|----------
> user      | 1             | TypeError  | TypeError  | TypeError
> internal  | 1             | TypeError  | TypeError  | TypeError
> user      | 0             | TypeError  | TypeError  | coerced
> internal  | 0             | coerced    | Deprecated | coerced
>
> Is this correct?
>


Yes, that's correct... although I'd be doing this for 8.2, to avoid
TypeError exceptions being introduced for non `strict_types` scripts in 9.0.

This is based on the feedback from the quiz and here; so type coercion from
NULL would continue to work, like coercion from the other variable types
(string/int/float/bool).

Craig

Reply via email to