Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92802 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 6814 invoked from network); 26 Apr 2016 17:01:08 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 26 Apr 2016 17:01:08 -0000 Authentication-Results: pb1.pair.com header.from=codekestrel@googlemail.com; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=codekestrel@googlemail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain googlemail.com designates 74.125.82.67 as permitted sender) X-PHP-List-Original-Sender: codekestrel@googlemail.com X-Host-Fingerprint: 74.125.82.67 mail-wm0-f67.google.com Received: from [74.125.82.67] ([74.125.82.67:34437] helo=mail-wm0-f67.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id F1/14-20013-0DE9F175 for ; Tue, 26 Apr 2016 13:01:08 -0400 Received: by mail-wm0-f67.google.com with SMTP id n3so6801311wmn.1 for ; Tue, 26 Apr 2016 10:01:03 -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=cu7ZJJGuZg8xxqkp7OmzYxKtLMu54I4+eQMSCARwV28=; b=ZUW/BJNEsrwxsXzSwo/n4TklYCzYS+rZhOr/upT2mvviuq/LkmuuAVePzLqiYPb0AR 3USNosdb1K/C3I/96QGe8/fer0Rur8gcN8zERADN2xVY64tK6hPwdzkIJlXfrXlpAcqp gY5nzLbEmkSXhgP6prY7xfgwvOJ47sqbFhtAJelSfTePRUzDpc/GJm2GVcBAU2oxEtKg P95ORBKsZBUbz8BDUePZwOMlJYxeIOEDaPTKy3UiswrYWpEr6nBFGSetAmmKHwkktfDI qWhExHb2Upxi+FPLROuaH+wZv0XxL76XlhmSxfcP7QW+nyxa74hpmIDnar/IRWHT9z0U Jb2A== 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=cu7ZJJGuZg8xxqkp7OmzYxKtLMu54I4+eQMSCARwV28=; b=Xr7sZRDCCL4ig/Rtd0NQX2Kfz4cJ1QX3vveXemtLF8vgcIqwyBDtUasLzvCxegvxr/ ifV+WZbQ0TklNINjHyrRMoF7UzvFJCA51Ni8hFyNdJeogmahZTspVjUjCH0kaQk2O5zw 53txE9CySw8HFBRxe/+9h0+DFqdKzy+jCiyJMBSGV6Xr1PSQfIheBTmo5M2pPdHY7Zxx qE3ysTZE2IiCtpFsIu64twoPjBl//eDdSSGWuSvefbdVXgc7T0GIguQ5KRWolI79Zexf M7+cXJLKwP/nRBoeQoGP7NebOpdQ+v/jpL7PYJX2J+XCPhfpGpECE+zGdEqUo02MM1/y J2bg== X-Gm-Message-State: AOPr4FUE+Vuxqd1xCiWC621LEIbmwfxlXoUpzVu77DEo76+a58vWgiY88EcMsw5KePyFY32CGaNYh81/5en+qA== MIME-Version: 1.0 X-Received: by 10.28.138.193 with SMTP id m184mr20197161wmd.100.1461688985886; Tue, 26 Apr 2016 09:43:05 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Tue, 26 Apr 2016 09:43:05 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Tue, 26 Apr 2016 09:43:05 -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: Tue, 26 Apr 2016 17:43:05 +0100 Message-ID: To: Dmitry Stogov Cc: rowan.collins@gmail.com, PHP internals , Stanislav Malyshev Content-Type: multipart/alternative; boundary=001a114422bec6ab91053165fc98 Subject: Re: [PHP-DEV] [RFC] PHP Attributes From: codekestrel@googlemail.com (Dominic Grostate) --001a114422bec6ab91053165fc98 Content-Type: text/plain; charset=UTF-8 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" 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 --001a114422bec6ab91053165fc98--