Re: [RFC] Patch for Union and Intersection Types
| From: | Fleshgrinder | Date: | Tue, 26 Apr 2016 19:34:07 +0000 |
| Subject: | Re: [RFC] Patch for Union and Intersection Types | ||
| References: | 1 2 3 4 5 6 7 8 9 10 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-92816@lists.php.net to get a copy of this message | ||
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
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc