Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92561 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 83973 invoked from network); 20 Apr 2016 17:55:56 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2016 17:55:56 -0000 Authentication-Results: pb1.pair.com header.from=jesseschalken@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=jesseschalken@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) X-PHP-List-Original-Sender: jesseschalken@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-ig0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:37226] helo=mail-ig0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id BD/F1-14036-CA2C7175 for ; Wed, 20 Apr 2016 13:55:56 -0400 Received: by mail-ig0-f170.google.com with SMTP id g8so56854327igr.0 for ; Wed, 20 Apr 2016 10:55:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc; bh=GywIiRw9jQYo4NW+by5xKJ7Qga9fJDjmxjRu/ZZZ/Lo=; b=ms4f6CiRaST4R/bKNcI6wQAQXBG8N8VaxOZ1uW2nIdOgsLnYW9sca846aeQC1XydOE KRppAXQmIZXI9ji7SA1vRDNBAHhIg3wXBIT+kf+a6+QlGwKwNQIgNcLDlg2OooztzudH DBl73NTRNvitckM2FnqnkJLx/Ck6vrH0xtD0LsIi7bcAXp84Qm/YNt9TTZaeouq0C3EY 0G1um6WNgcoEbLyLhtyk2GrEUKMhAC0Er6arl3tUmzQ5tNT9CrC+chx1j0ZBnPLJRUv6 rwk394pY5zzfDd2AyOg+PzhcYt25zfDw5Tal+1SnkjVa4LGZAro0gjdN3lWM6J9xqHwQ x8tg== 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=GywIiRw9jQYo4NW+by5xKJ7Qga9fJDjmxjRu/ZZZ/Lo=; b=g5QkgbF2UH2zA+SdtvUIlUnWAaBTI2QY4MDzhGy+27Xm5Pl0eAaeINwqXe7YzMsU0c HA9GCKqneB5wkiQO4QFi0dwY3HgmGx2jjUahaRlMev03CS4q5YJKgOD7eJcDRlwVYwRp gbq1mzBCHrwnYvkjC748Q0TViyvXpKXAqQ9x3RZVOrMPxaKkRwV4C3pf/6t1mdnfKwGA 6Om4jotpvl+A1ISiD6PsiqsQV9II8GXjZ+TCY3HnlTDl30wv65ZFyGDjDiYMmrQ6YIFJ 61s73zl7kQT0+6enusQaP55JqQCGKZnjadTSwDoupMRRnKtmVZ3Rlx7jwlWo5J2cXOet AxPQ== X-Gm-Message-State: AOPr4FXIWP2JIVIdXGz1spSwviY0jrfpzD4CUhhOsioMZDeHrQptIj7vSWV0erRrn57XzORqmdhxLGx56AP91Q== MIME-Version: 1.0 X-Received: by 10.50.72.107 with SMTP id c11mr5173501igv.85.1461174953828; Wed, 20 Apr 2016 10:55:53 -0700 (PDT) Sender: jesseschalken@gmail.com Received: by 10.79.139.133 with HTTP; Wed, 20 Apr 2016 10:55:53 -0700 (PDT) In-Reply-To: References: Date: Thu, 21 Apr 2016 03:55:53 +1000 X-Google-Sender-Auth: MiFhIazRo1IRcTmYtTXrTw_8X3U Message-ID: To: Levi Morrison Cc: internals Content-Type: multipart/alternative; boundary=047d7bdc15ba13e9e40530ee4e1f Subject: Re: [PHP-DEV] [RFC] Nullable Types From: me@jesseschalken.com (Jesse Schalken) --047d7bdc15ba13e9e40530ee4e1f Content-Type: text/plain; charset=UTF-8 I read the RFC and it all sounds good to me. I appreciate the care taken to ensure method compatibility rules are correct, a smooth interop with =null, and to consider impact on union types if added later (? just becomes sugar). I'm not sure if it's been mentioned or not, but the position of the ? has impact on the ability to add a foo[] shorthand for generic arrays. Namely, if the ? is at the start, then the syntax becomes ambiguous. string[]? (nullable array of strings) string?[] (array of nullable strings) ?string[] (ambiguous, need to consult precedence rules and/or use brackets) I'm not sure how HHVM/Hack deals with that, or if it even has the foo[] shorthand. On Thu, Apr 14, 2016 at 1:42 PM, 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]. > > I look forward to a helpful and meaningful discussion! > > [1]: http://news.php.net/php.internals/92252 > [2]: https://wiki.php.net/rfc/nullable_types > [3]: https://wiki.php.net/rfc/nullable_types#position_of > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --047d7bdc15ba13e9e40530ee4e1f--