Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:82532 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 78174 invoked from network); 12 Feb 2015 13:21:27 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 12 Feb 2015 13:21:27 -0000 Authentication-Results: pb1.pair.com smtp.mail=marcio.web2@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=marcio.web2@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.217.172 as permitted sender) X-PHP-List-Original-Sender: marcio.web2@gmail.com X-Host-Fingerprint: 209.85.217.172 mail-lb0-f172.google.com Received: from [209.85.217.172] ([209.85.217.172:63667] helo=mail-lb0-f172.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F5/25-50473-6D8ACD45 for ; Thu, 12 Feb 2015 08:21:26 -0500 Received: by mail-lb0-f172.google.com with SMTP id p9so8611592lbv.3 for ; Thu, 12 Feb 2015 05:21:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=xsyQ90jaM+JjBLgnElXDInoNS0jnsfjvzKqblbXsh/w=; b=ca/Kt7IOtUoEkP52kdn+L8IhCC/giJXKrLJ6wvXvwlb6sjQR8ZCxA8twodDEZ8nzXQ mjXfxCV+bueHEpR1WDA9AuuYZBNV7TxVA0lTN3/iPk5VHKG0O+4B7boZqKOrVzXTsvtz Rdsayx7vehdyDXUEBmdGmFCMSf2+QijoJoIBotUKD1xru+JEroAEFrTqL8QUk2eejiO3 jI0BNx8UqbVtFSVH4ZXF8PhSnAiVXWO4/Wia2RayVC0Rr/SlX6TTUxcEeQFLzXYg9xqf EmWCHmZKBxYFtzR+veQhnSAAruFOsiqmKCJoE+T7DYKbZLI+dLeI5RVUDbjyF8iuhAT8 ytCQ== X-Received: by 10.112.159.195 with SMTP id xe3mr3334581lbb.64.1423747283108; Thu, 12 Feb 2015 05:21:23 -0800 (PST) MIME-Version: 1.0 Received: by 10.152.21.101 with HTTP; Thu, 12 Feb 2015 05:21:02 -0800 (PST) Reply-To: marcio3w@gmail.com In-Reply-To: <54DC788E.7000000@hoa-project.net> References: <54DC788E.7000000@hoa-project.net> Date: Thu, 12 Feb 2015 10:21:02 -0300 Message-ID: To: "Ivan Enderlin @ Hoa" Cc: PHP internals Content-Type: multipart/alternative; boundary=001a11c3c9660f49f7050ee3ff94 Subject: Re: [PHP-DEV][RFC][VOTE] Group Use Declarations From: marcio.web2@gmail.com (Marcio Almada) --001a11c3c9660f49f7050ee3ff94 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable > Thanks for the RFC! > We discussed a little bit with the Hoa [1]'s and fruux [2]'s community and we have a question. > Why not pretending we have an array of symbols, something like: > use Foo\Bar\[Baz, Qux]; > instead of > use Foo\Bar\{Baz, Qux}; > This is a list vs. block debate. While I personally would go for `{` and `}`, here we declare a list, so we guess the array syntax > would be more tailored. > Thoughts? Hi, This is an interesting one. During research, the `[` and `]` syntax was considered for a while but it quickly felt apart for the following reasons: 1. Most people considered on PHP the array construct is a very important building block and therefore we should avoid to multiplex or reuse its syntax in multiple contexts. This becomes more clear in cases involving conflict resolutions: use Foo\Bar\[Baz *as* Buz, Qux\Quaz *as* Quiz]; 2. Block syntax seemed more versatile and prone to reuse because we already have the traits conflict resolution syntax: http://php.net/manual/en/language.oop5.traits.php#language.oop5.traits.conf= lict The reasoning for using commas to delimit imported entities and not `;` is that current use declaration syntax is a comma separated list: use function foo\math\sin, foo\math\cos, foo\math\cosh; Hence the `{..., ...}` syntax seemed the most tailored to feel similar and obvious for most of the current PHP userbase, based on all experiments: use function foo\math\{ sin, cos, cosh }; use function Foo\Bar\{ A, B as Baz, C }; I hope that the given information is useful to your decision process. Good voting! Sincerely, M=C3=A1rcio Almada. --001a11c3c9660f49f7050ee3ff94--