Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92290 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 14897 invoked from network); 14 Apr 2016 09:59:13 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 14 Apr 2016 09:59:13 -0000 Authentication-Results: pb1.pair.com smtp.mail=me@daveyshafik.com; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=me@daveyshafik.com; sender-id=unknown Received-SPF: error (pb1.pair.com: domain daveyshafik.com from 209.85.215.50 cause and error) X-PHP-List-Original-Sender: me@daveyshafik.com X-Host-Fingerprint: 209.85.215.50 mail-lf0-f50.google.com Received: from [209.85.215.50] ([209.85.215.50:32975] helo=mail-lf0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id EB/E6-12455-0F96F075 for ; Thu, 14 Apr 2016 05:59:13 -0400 Received: by mail-lf0-f50.google.com with SMTP id e190so102642711lfe.0 for ; Thu, 14 Apr 2016 02:59:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=daveyshafik-com.20150623.gappssmtp.com; s=20150623; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=WF7DCfk2dDOjgDZMjZlybUPVJu6XNqNampTsckaJU5k=; b=Y7X1wwtoKZqV0hjtfDVgpbzNnwvSHdRqnA8yrQj7/KEkPupyZARqU2wbnTBnc1Z5Mj df+pBLdfSBwJXogHoKbcL5Jnb7y/B4D3RB1rckzElV+WKAmrou8sa/PttAjSo7Lmneyr cj5w9sEYVzW0BkVgqPJ2z8vC6ilU9TGq596BdOe9jpD0jLbddytO2sY2ke0T+MuqmnhL qs4VHTKuDBjzJkIy0YBZG5J0FVn7eTCYRPnCxBo0x3O3dUhYfSMNORimuRIDLUpyvD2k 2bT8LV+qB/tdESN3/qVsXxAhN4FNci9F2qkt8tG3ZQa9Xq5vP43KCPTaT9HPD7BUKvWy uGGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:date :message-id:subject:from:to:cc; bh=WF7DCfk2dDOjgDZMjZlybUPVJu6XNqNampTsckaJU5k=; b=Ecf/gfHmuG/T9r+ys5xUXmcedK7czDCMv+yHiSFwRO80JxSFFIgnTGnhEvmokhk6jH OYxcWI8wubDbyxHuudGWyS0sgzl+rmhOnBgS9cjIAbF3bnfaKkUVXVxvS6C8/v6NSbdX 0cWdnFdsvjx6y85Fk1VsuZp+E3B0SR12PADr6JY/fKvbj4ak3yHMH8su/LXrdM3JdJMG f3nlnq8HXnn8PHmbGqRwsxBD6rEPTe8bWhOAnnZFScfgZOo4JOtvEhA33aVjuaJTsD9T Nj5MzzXJ7WXEGbKB+UxwBqp2ozXIJA5iCF+rFgKqEDcGHKRD0akNSOvu+dqEIMQrQ+QL FlbQ== X-Gm-Message-State: AOPr4FXMBjXTSirFB+NeNJ1SSwKOg5IZJ6Kr4Y8AfXLlmxll8ndXIb8SkXSGVc6nSpCGw2Ic6nmUWgsm3e8kTHWH MIME-Version: 1.0 X-Received: by 10.25.151.75 with SMTP id z72mr6242679lfd.30.1460627949494; Thu, 14 Apr 2016 02:59:09 -0700 (PDT) Sender: me@daveyshafik.com Received: by 10.25.125.196 with HTTP; Thu, 14 Apr 2016 02:59:09 -0700 (PDT) In-Reply-To: References: Date: Thu, 14 Apr 2016 02:59:09 -0700 X-Google-Sender-Auth: 5svwKcj8g70Xqd2sIBfHCVWZn7Y Message-ID: To: Derick Rethans Cc: Levi Morrison , internals Content-Type: multipart/alternative; boundary=001a11401f2014436805306ef2eb Subject: Re: [PHP-DEV] [RFC] Nullable Types From: davey@php.net (Davey Shafik) --001a11401f2014436805306ef2eb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, Apr 14, 2016 at 2:00 AM, Derick Rethans wrote: > On Wed, 13 Apr 2016, Levi Morrison wrote: > > > As alluded to in an earlier email today[1] I am now moving the > > Nullable Types RFC[2] to the discussion phase. In a nutshell this RFC > > proposes syntax for declaring a type to alternatively be null. > > > > There is a decision that needs to be made: does the question mark go > > before or after the type name? > > > > function (?Foo $foo); > > function (Foo? $foo); > > > > There are precedents in several languages for each position. Some > > relevant issues to where the question mark goes are noted in the > > RFC[3]. > > Please put it where HHVM puts it: in front of it. Other languages are > less of an issue than a syntax that's already used in a somewhat PHP > language. > > As to the rest of the RFC: LGTM! I much prefer the "Nullable Foo" (?Foo) to "Foo or Null" (Foo?). I find it easier to read. However, I am not a fan of introducing both this and the "Null" type for union types =E2=80=94 this should be the only way to create nullable types.= We already have too many things that are possible in more than one way. As it sits, this is purely syntactic sugar (when taken in tandem with union types) and [if] we agree that it is good, then let us just forgo the other syntax entirely. I'll add a little about that on the appropriate thread. - Davey --001a11401f2014436805306ef2eb--