Re: NULL Coercion Consistency
| From: | Craig Francis | Date: | Mon, 09 May 2022 23:12:55 +0000 |
| Subject: | Re: NULL Coercion Consistency | ||
| References: | 1 2 3 4 5 6 7 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-117708@lists.php.net to get a copy of this message | ||
On 8 May 2022, at 12:38, Mark Randall <marandall@php.net> wrote:
> On 08/05/2022 11:48, Jordan LeDoux wrote:
>> This is not the case with null. If you use the unset() function on a
>> variable for example, it will var_dump as null *and* it will pass an
>> is_null() check *and* it will pass a $var === null *and* it will return
>> false for an isset() check. Null loses these qualities if it is cast to
>> *any* scalar.
>
>
> Fortunately the writing is on the wall for the undefined cases, but that doesn't take away
> from your argument.
Yep, I agree, an exception for an undefined variable is probably fine... I'm looking at
variables specifically being set to to the NULL value, and how that NULL value is coerced.
Craig