Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:71280 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 64881 invoked from network); 19 Jan 2014 22:02:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 19 Jan 2014 22:02:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=php@golemon.com; spf=softfail; sender-id=softfail Authentication-Results: pb1.pair.com header.from=php@golemon.com; sender-id=softfail Received-SPF: softfail (pb1.pair.com: domain golemon.com does not designate 209.85.160.54 as permitted sender) X-PHP-List-Original-Sender: php@golemon.com X-Host-Fingerprint: 209.85.160.54 mail-pb0-f54.google.com Received: from [209.85.160.54] ([209.85.160.54:37471] helo=mail-pb0-f54.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 83/11-61840-E7B4CD25 for ; Sun, 19 Jan 2014 17:02:38 -0500 Received: by mail-pb0-f54.google.com with SMTP id uo5so2594051pbc.27 for ; Sun, 19 Jan 2014 14:02:34 -0800 (PST) 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:content-type; bh=rXxv1F3+38SkqkwUumYxIulo+VBW3Ba+mzuhnk0JpwM=; b=Gy9V5SZOaZB9Hg29PEju7Y4lFxs4J/IzQtEkzhMHk29zkDB3N0NX1YRHEgt8tXR9P3 VzNRYDvb9WTn9aHx2Wf+VYFgJ0HGh/C1MgVdoGT3HTBCIZrrv2v3qxv2oUpzox/NetqA 6ETjJ9ri2eycEQ08luE7LcMzqE5lgJchpDzPgOCfTvq1Be1PJonjjCQQW76MUS4BcG02 R4yUS0XBMTg9jHMOQPhNZyMtPwYWnIhzR1kV5ieRobci/b0/YCY91+QzbaJZOCplywEz gUFg5IoIQHRh8CIoluxbAauDAlZa5NtRL0dIyZziwZG4dO8yOEVgQmhNZl6fBhWczRPp bk5w== X-Gm-Message-State: ALoCoQnDAJFzfe4JbQ1acciBdric+iN6r83T2PJZaBp71OR5GpyznlsFtQESLjE3qoBvT4xYh60a MIME-Version: 1.0 X-Received: by 10.68.171.99 with SMTP id at3mr11163303pbc.109.1390168954835; Sun, 19 Jan 2014 14:02:34 -0800 (PST) Sender: php@golemon.com Received: by 10.70.77.164 with HTTP; Sun, 19 Jan 2014 14:02:34 -0800 (PST) X-Originating-IP: [2001:470:1f09:2fa:22c9:d0ff:fe87:295b] In-Reply-To: <52DC125C.4010609@ajf.me> References: <52DC125C.4010609@ajf.me> Date: Sun, 19 Jan 2014 14:02:34 -0800 X-Google-Sender-Auth: AC36fXK7tCML9Oq1S_zbtquMkaQ Message-ID: To: Andrea Faulds Cc: Philip Sturgeon , "internals@lists.php.net" Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [PHP-DEV] Introducing "Array Of" RFC From: pollita@php.net (Sara Golemon) > However, I have but one little issue with the HHVM syntax. Why is the ? > before the type name? I much prefer the C#-style Bar? to this confusing > ?Bar. I suppose this is only a minor issue, though. > Two reasons come to mind, both essentially aesthetic: * Symbol crowding: function foo(array? &$bar) { } bar by ref expects array, but may take null (which is perfectly common for a by-ref variable). Trouble is, '? &$' is starting to look perlish. * Generic expansion: Prefix: function foo(?array> $baz)... Suffix: function foo(array>? $bar)... Both proclaim a nullable array of non-nullable Bar objects of nullable type int. The prefix version makes it much more obvious which '?' goes with which portion of the type structure. function foo(array?> $baz)... sounds tempting, but some shift/reduce conflicts start to emerge out of that stacking of tokens. Resolvable, of course, but complicating the parser rules over a bit of aesthetics like that.... You can't see it, but I've got my frownie face on right now. -Sara P.S. - I'm not voting for or against anything at this point either. Just offering input during discussion phase, as we're all meant to. :)