Re: [RFC] [VOTE] Union types

From: Date: Tue, 14 Jun 2016 16:09:53 +0000
Subject: Re: [RFC] [VOTE] Union types
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-93955@lists.php.net to get a copy of this message
On 6/14/2016 5:22 PM, Derick Rethans wrote: > Not clear on some of the wording. When you say: > > "This RFC proposes a vote on whether ?Foo shall be replaced by Foo | > null in general." > > Do you mean that ?Foo will no longer be allowed at all if this RFCs > passes? > > cheers, > Derick > Same question here, since https://wiki.php.net/rfc/nullable_types already passed and directly voiding it makes no sense. I mentioned this before but maybe it is better to change the RFC to disallow the question mark if an union type is in use: # OK ?string null|string string|null ?SomeClass SomeClass|SomeOtherClass|null null|SomeClass|SomeOtherClass SomeClass|null|SomeOtherClass # BAD ?SomeClass|SomeOtherClass ?SomeOtherClass|SomeClass ?string|int ?int|string This would be a perfectly valid and reasonable restriction that makes sense in every way because it helps to avoid ambiguity. However, disallowing ?T is not. -- Richard "Fleshgrinder" Fussenegger

Attachment: [application/pgp-signature] OpenPGP digital signature signature.asc
« previous php.internals (#93955) next »