Re: Passing null to parameter
| From: | Craig Francis | Date: | Tue, 14 Nov 2023 13:46:06 +0000 |
| Subject: | Re: Passing null to parameter | ||
| References: | 1 2 3 4 5 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-121672@lists.php.net to get a copy of this message | ||
> On 10 Nov 2023, at 20:00, Rowan Tommins <rowan.collins@gmail.com> wrote:
> [...] Wherever it is used, "null" is a confusing and often controversial concept. In
> different contexts, it is used for different things, and has different ideal behaviours. It's a
> whole debate on its own, and bringing in other types of coercion just confuses the conversation.
Thanks for the background detail Rowan, that is useful (I have re-read a few times).
I know I won't have a 2/3 support for NULL coercion with function parameters, so I'll just
wait until 9.0 is made available, and assuming I'm correct (hopefully I'm not), we can
address the BC problems then.
For now, I'll just try to remember to do things like
(trim(strval($search)) !=
''), and hope that static analysis tools move their NULL type check down to their
lowest level:
https://github.com/phpstan/phpstan/issues/10127
Craig