Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92357 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 11783 invoked from network); 16 Apr 2016 01:02:02 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 16 Apr 2016 01:02:02 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@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: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-ig0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:38287] helo=mail-ig0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/9D-29891-80F81175 for ; Fri, 15 Apr 2016 21:02:01 -0400 Received: by mail-ig0-f170.google.com with SMTP id ui10so37903837igc.1 for ; Fri, 15 Apr 2016 18:02:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to; bh=j6VxO+2E2I5yQ5axQhmtHiD/tKrNFVctuKZCWGQWsoE=; b=PA+0eIlhGV4mbrhguggcWOT/q15ADipBerxWCsCvu32AlOzh/cGku4jAFitQPP9dfA cmplcjpHt0qL9wx0GE9SAhceGikMKjaoLPG6pfHsFwJe6SGa1llUGG5jFjjEjOt5J42x ovS7hALEtVDHLiqSo0o0vF7zhyswG6UNWj7C3/jCaaQ9aM4f8UrJ2hg9lUQ2igPV3yDG IkOr1mrg3DPmlHphVS7RXgLiXET80cVtsffBVNwzZ5HjU4Zlp+2ixN8VKY8TkHUFRZjZ 1lpZkuMnOkFgzifgUZf3RI6nCetyYTFxApVSHiG35o+forM9MzeSK4c9pccc7XYJc7Wd 0+gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=j6VxO+2E2I5yQ5axQhmtHiD/tKrNFVctuKZCWGQWsoE=; b=Vz/i/EmZSZxD/hMA8h0/ZBQ8Nvik9CBdxJpQaRH1AYkE6bomY2oNX07LzJKZTVOeqE UiInYMfxc1KyIIk9fWKZgMfs1owQx5hMbzzXWPgZTeoxTEKtWGLuBcN/sgtFcaNA1AFp dYKfwARvIuLiQsfE/HdP7/l3hV4P8dVVNKqqKPvpDi3n0Le0oRCvBfrLFqwmTLacB9mG dO+yrZHS72S4leBBj2sOwAVmGbAC+Seo4/39wjQy1lSu59rrOYsr0/Z0dk53OE95cDkg KGGD8gl2zT+FpJpOoKLmquZVnI+WmNcHwwlGnLw4ZcnnUyXnz5I5m5yK9NiWS2m0cPkb ckRA== X-Gm-Message-State: AOPr4FWAuAIOKD92GEB6FAGJHY8AYWTWh1SZko9hITniD5Ig0W2/oSGZesk4G6GJtqvOf7kLZkwEpqQobKMw6g== X-Received: by 10.50.67.36 with SMTP id k4mr8278582igt.89.1460768517659; Fri, 15 Apr 2016 18:01:57 -0700 (PDT) MIME-Version: 1.0 Received: by 10.50.85.10 with HTTP; Fri, 15 Apr 2016 18:01:38 -0700 (PDT) Date: Fri, 15 Apr 2016 21:01:38 -0400 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=047d7bdc188898252a05308fac3a Subject: Trying to fix "use" language inconsistencies From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") --047d7bdc188898252a05308fac3a Content-Type: text/plain; charset=UTF-8 Hi internals, It all started with a PR over doctrine/annotations ( https://github.com/doctrine/annotations/pull/69), where a contributor decided to propose supporting group use support. The issue starts with this, which it is perfectly supported: use Foo\Bar, Foo\Woo; While multiple group uses are not: use Foo\{Bar, Baz}, Qux\{Corge, Grault}; Then I decided to see what is really supported by the newly introduced group use. According to the grammar, these are the same lines: use Foo\Bar, Foo\Baz; use Foo\{Bar, Baz}; use function Foo\Bar\baz, Foo\Bar\qux; use function Foo\Bar\{baz, qux}; use Foo\Bar\{function baz, function qux}; However, this feature leads to an inconsistent behavior in the language. Mixed group use types are supported: use Foo\Bar\{Baz, function qux}; While mixing use types are not: use Foo\Bar\Baz, function Foo\Bar\qux; This brings the question of whether we should continue this madness path of inconsistency or we start addressing inconsistencies one by one in the language. I'd like to propose options that we could fix this: - Remove mixed group use types support (this would become invalid: use Foo\{Bar, function baz};) - Add mixed use support, which would contradict the approach took by typed properties (this would require this approach: use function Foo\Bar\baz, function Foo\Bar\qux;) One of the approaches needs to be taken in order to support multiple group use, otherwise we have a reduce/reduce yacc error that can't be fixed (well, my yacc/compiler's knowledge hit a dead end there, without doubling all the grammar rules and taking an overly complex route). Ultimately, the question comes around if we should consider support of multiple group use. If positive, I'd suggest approach two (I already have a patch for that! =D). I'd like to gather opinions around this, so I can properly implement and propose a patch through an RFC process. Regards, -- Guilherme Blanco Lead Architect at E-Block --047d7bdc188898252a05308fac3a--