RE: [PHP-DEV] [RFC] [VOTE] Union types

From: Date: Wed, 15 Jun 2016 13:38:15 +0000
Subject: RE: [PHP-DEV] [RFC] [VOTE] Union types
References: 1 2 3 4 5 6 7 8 9  Groups: php.internals 
Request: Send a blank email to internals+get-94010@lists.php.net to get a copy of this message
> -----Original Message----- > From: morrison.levi@gmail.com [mailto:morrison.levi@gmail.com] On Behalf > Of Levi Morrison > Sent: Wednesday, June 15, 2016 1:51 AM > To: Zeev Suraski <zeev@zend.com> > Cc: PHP internals <internals@lists.php.net> > Subject: Re: [PHP-DEV] [RFC] [VOTE] Union types > > On Tue, Jun 14, 2016 at 2:43 PM, Zeev Suraski <zeev@zend.com> wrote: > > There are more than enough constructs in PHP to handle all these use > > cases, and handle them nicely. We don't need specialized constructs > > for every use case. > > To clarify here, you are saying we don't need unions because they are a > special case, yes? But you previously stated you are in favor of special casing > the language types such as numeric? > > These are at odds. They're not. Let me supplement what I said: We don't need specialized constructs for every use case; They make sense for ultra-common ones only, and only if the added benefit (compared to doing it using the methods currently available) outweighs the increased cognitive burden. Hence, 'numeric' makes perfect sense, while a generic Union Types feature does not. Zeev

« previous php.internals (#94010) next »