Re: [RFC] Patch for Union and Intersection Types
| From: | Levi Morrison | Date: | Tue, 26 Apr 2016 19:40:38 +0000 |
| Subject: | Re: [RFC] Patch for Union and Intersection Types | ||
| References: | 1 2 3 4 5 6 7 8 9 10 11 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92817@lists.php.net to get a copy of this message | ||
On Tue, Apr 26, 2016 at 1:34 PM, Fleshgrinder <php@fleshgrinder.com> wrote:
> On 4/26/2016 9:13 PM, Bob Weinand wrote:
>> There's undefined (= not a value) and there's the value null. We just don't
>> expose undefined to userland. [You see it when accessing undefined variables, which PHP converts to
>> null with a notice for example.]
>>
>> Null is definitely a value. You can pass it around, reflect on it, assign it etc..
>> And as it is a value, it also has a type, which is null.
>>
>> Null is not special, it just has specific behavior, like any other primitive type has. The
>> only special thing is that it's allowed as a default value with function (Foo $foo = null), but
>> this should be somewhen deprecated and removed once we have proper null unions.
>>
>> If you want to continue arguing, please open a new thread, but don't side-track this
>> thread to much, please.
>>
>> Bob
>>
>
> Null is a type, no argument there!
>
> Deprecation of null as default value makes no sense, nor does it make
> sense to deprecate 42 as default value. ;)
>
> --
> Richard "Fleshgrinder" Fussenegger
>
I think he meant to post a different case:
function (Foo $foo = null, $concrete_param);
This is based on a conversation I've had with him elsewhere.