Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92563 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 87828 invoked from network); 20 Apr 2016 18:28:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Apr 2016 18:28:23 -0000 Authentication-Results: pb1.pair.com smtp.mail=morrison.levi@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=morrison.levi@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.220.68 as permitted sender) X-PHP-List-Original-Sender: morrison.levi@gmail.com X-Host-Fingerprint: 209.85.220.68 mail-pa0-f68.google.com Received: from [209.85.220.68] ([209.85.220.68:33258] helo=mail-pa0-f68.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 34/B2-14036-64AC7175 for ; Wed, 20 Apr 2016 14:28:22 -0400 Received: by mail-pa0-f68.google.com with SMTP id vv3so5202162pab.0 for ; Wed, 20 Apr 2016 11:28:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=7NfhFWaDsodaYFV+zj4DYzJHNMAPjyvynCKr/2kWLhw=; b=K/v10dyFaX6OVfJjXbkcSDIU1VDYHz1oQuyYs3AmKv8uqKWXV02YijmuZb6tN57AWL vGY1m9HlBbKPFWIFYAtX5SAH2O5obgW1z4NrbRhlpGvdAf33YnDb2oEeD3rEyL/hviap OeGG7f1kNQSmzRXJsuFIxXCGD85y8njEipWlnZLTeKNmMxbqGK7A87HNX0jg6OyabNRo T8ahbJCanXCX0gH3IYqJVSJ4hiKp0OJkCrzYY5JyeCKsJ4Va0TvonJM0h6c9VHJTckYJ WJIbe4Zo5mG/e3OPQ01cLGtTYv3vYVRxKUNX3fb3O2uTk1bWnd8oIwlMIwn8oojYyc+H CP1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=7NfhFWaDsodaYFV+zj4DYzJHNMAPjyvynCKr/2kWLhw=; b=kLfcK4/UjTocLbTaC3KzX6KOpqRlaBiv6lW4uaoKf4Y+DZibYfSJFpbZ49zBszAIZf p7qthtzesGZ1prkKMYp3p+2HdUSyg5JfgBZ6vedGbnrxymhQJiBx1RW/apUegixc7mg6 a+VPlFxzLR5x1sSIUiV52GjjQil/QOzmlbr936JgPlEVW4SM0JOXNT/vIepysY729xSW LOx35khLf3gKAh7N19AFSd1qI2miSEZm4fyyk6T2YaYrIkrdXyWwoidt6KA7bwm1StpW fJABtWN483VvPlGDDlBuFNxA3YDwr8SvkbkmLwbMoZLHNREKK9O8tPGWnKk/NeSmBi1W WjuQ== X-Gm-Message-State: AOPr4FVW32dNkr6JjSgd+m/1DNl+BuqdU7QOqFb826l5ODKRoJPHgr0dEF/p06PbGAMNXxsHFqsn9o0VtC8GiQ== MIME-Version: 1.0 X-Received: by 10.66.66.42 with SMTP id c10mr14121094pat.119.1461176897918; Wed, 20 Apr 2016 11:28:17 -0700 (PDT) Received: by 10.66.132.79 with HTTP; Wed, 20 Apr 2016 11:28:17 -0700 (PDT) In-Reply-To: References: Date: Wed, 20 Apr 2016 12:28:17 -0600 Message-ID: To: Jesse Schalken Cc: internals Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] [RFC] Nullable Types From: morrison.levi@gmail.com (Levi Morrison) On Wed, Apr 20, 2016 at 11:55 AM, Jesse Schalken wrote: > 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. You would write `array`; Hack doesn't have a short-hand syntax.