Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92827 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 61981 invoked from network); 26 Apr 2016 23:48:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2016 23:48:38 -0000 Authentication-Results: pb1.pair.com smtp.mail=codekestrel@googlemail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=codekestrel@googlemail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 74.125.82.68 as permitted sender) X-PHP-List-Original-Sender: codekestrel@googlemail.com X-Host-Fingerprint: 74.125.82.68 mail-wm0-f68.google.com Received: from [74.125.82.68] ([74.125.82.68:35642] helo=mail-wm0-f68.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 07/DE-20013-55EFF175 for ; Tue, 26 Apr 2016 19:48:37 -0400 Received: by mail-wm0-f68.google.com with SMTP id e201so8279227wme.2 for ; Tue, 26 Apr 2016 16:48:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=K6KCjixo/hGTuT6dngnsfRU7HLLdzIW0Fkm7O6MnC5E=; b=kGO7Xcv369JQG5Rb/Zt536w9nipWDsGjYy9EATCa2zfdk7wto9siGeaxq1Bro/nnWh Vney843GOcqal2vwtUT5N5cYnQdNu0eXxm93aR2kFEtyar74BNmcZjgO80fzLQf/cweQ 9k1IfNNE2ALwlrJtx23wMi5weK/XVXT711WTVBGJFFoIdhwkTayMD5Ckb2L9RUsx2Iyi xtT7kgxSQ0ZHTzoBIeRVtLb/XI2DdnNcXRVr5ts3cehni0JjZlOjITc3RR06PStYOqxx KN3RKa7z4j0E/aE3ngTMlR/xmw/yhMHG2H3232yZXknrcHA+1rshM7n/sQz0jLRXvYy2 sYsA== 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=K6KCjixo/hGTuT6dngnsfRU7HLLdzIW0Fkm7O6MnC5E=; b=RePxGRGQP6CmzU1oOGu1Hk5fCF6a8EOVewVv9HGvvVOfuo9nftAdjGZy47HMZN/vjI m+rWnH5fKTy09n+b4x5CssEAoc/QpECQO6IPtUwRTJq9hv/cwZvidLPx9WysEkzbTrxk Igl+SJV24LW8MmYQNUL/CE5t/iLYHmBoLex9P4BKrPfHVy9PUEng6cVlKQLnjOpjzuGx 3ybhM+b9Wtebjg+HCbMbMHCmlwqWym8Q7sAcs/GYtnFR9tB0moz2WEe8rnOlaj6O78vy 6PIqmSxuXc3JrYFA1rFl2yEFV5eMx5FDGupevkh30EyBOJTZtGmwcvAV64Xt9T2TZveQ E9Hg== X-Gm-Message-State: AOPr4FVeGiVZwVwsq2T90vANfLGXvnWceZE84m+Mp/adnrCBqOaV6AxCAsL7Xyb+Q4yc6QJTsLulkvfS0rkttw== MIME-Version: 1.0 X-Received: by 10.28.30.148 with SMTP id e142mr6155696wme.69.1461714514689; Tue, 26 Apr 2016 16:48:34 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Tue, 26 Apr 2016 16:48:34 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Tue, 26 Apr 2016 16:48:34 -0700 (PDT) In-Reply-To: References: <571DD94B.3060604@zend.com> <571E63D0.8080800@gmail.com> <9c24f969-cb0e-cb46-a23c-6e06e7de7d79@gmail.com> <571E7C08.6010309@gmail.com> <571F1B95.9030203@zend.com> Date: Wed, 27 Apr 2016 00:48:34 +0100 Message-ID: To: Pierrick Charron Cc: PHP internals , Dmitry Stogov Content-Type: multipart/alternative; boundary=001a114b245a6946a605316bee9f Subject: Re: [PHP-DEV] [RFC] PHP Attributes From: codekestrel@googlemail.com (Dominic Grostate) --001a114b245a6946a605316bee9f Content-Type: text/plain; charset=UTF-8 It would, but the short array syntax followed by a function/method decl would be unambiguous. On dmitry's note, I'm not sure maintaining similarity with Hack is justified. While Facebook maintains it as an open source project, they primarily built it for themselves, so I can only think they will prioritise their own needs over that of the PHP community. This make it an unattractive alternative to PHP in my eyes and it may explain why there are still so few projects on github written in Hack. I don't see any reason why PHP should follow in their footsteps when it concerns syntax. On 26 Apr 2016 7:33 p.m., "Pierrick Charron" wrote: > And it will probably be in conflict with the Short Array Syntax ? > > On 26 April 2016 at 13:14, Dmitry Stogov wrote: > >> Just because HHVM is closer to PHP than C#. >> >> >> ________________________________ >> From: Dominic Grostate >> Sent: Tuesday, April 26, 2016 19:43 >> To: Dmitry Stogov >> Cc: rowan.collins@gmail.com; PHP internals; Stanislav Malyshev >> Subject: Re: [PHP-DEV] [RFC] PHP Attributes >> >> >> Why not like C#? >> >> [Description("My Function")] >> function my_function() >> {} >> >> Without the semicolon, this wouldn't be valid in any other context. >> >> On 26 Apr 2016 8:41 a.m., "Dmitry Stogov" > dmitry@zend.com>> wrote: >> >> >> On 04/25/2016 11:20 PM, Stanislav Malyshev wrote: >> Hi! >> >> No, but this is valid: >> >> @atrr(); function foo() { ... } >> >> That's perhaps a little too close for comfort...? >> That's different syntax. If you put ; in the middle of statement, it can >> change - "$c = $a + $b;" is not the same as "$c = $a; + $b;" - but >> nobody thinks + can not be used because of that. As I said, << and >> >> are existing operators too, so if you are creative enough, I'm sure you >> can find cases like that too. >> >> Hi Stas, >> >> You may try to replace attribute syntax with @attr(...) (without >> semicolon) into our PHP parser. >> Note that we have LALR grammar + restrictions caused by semantic actions. >> If you are able to do this, I'll add it into the RFC as an option. >> >> Thanks. Dmitry. >> >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > --001a114b245a6946a605316bee9f--