Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92631 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 69336 invoked from network); 22 Apr 2016 08:31:30 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 22 Apr 2016 08:31:30 -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.65 as permitted sender) X-PHP-List-Original-Sender: codekestrel@googlemail.com X-Host-Fingerprint: 74.125.82.65 mail-wm0-f65.google.com Received: from [74.125.82.65] ([74.125.82.65:33035] helo=mail-wm0-f65.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 85/8F-14036-161E9175 for ; Fri, 22 Apr 2016 04:31:29 -0400 Received: by mail-wm0-f65.google.com with SMTP id r12so2314773wme.0 for ; Fri, 22 Apr 2016 01:31:29 -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=+yfEDmyLNIJ7O3kTqwFxss/QwPZU1eCcdBgpAodijIQ=; b=JUfk00rf7z3s53V24rO3SMlJbDzm/mZa9WRBKOsGSOlJkGxw/Venjeb/mEePD2wso9 lIvSSMlu01xBGZizs0BA0LCrzRR/mVbPk97QzuAnfa4sj7tUSHS+/DrIDCO5bDdZpOfD g+tj977WwCPlaA9/xaPpNXAo8tIOxmtx1pRjmRv+8Y5Lpye5H26l1lyhkEiJ22NOaRg8 d7aErOFEh86MFy2sXjzLUc2eUHU8dAjtp8CCdSVmHIht2t1z3Y43h7KYoc5ga9i1NrJm CPYG+ay5v4/dYKE+ROlqsx4AYf+vevdjfRZgjvLmGkmiEtwXhnmTuqYaQ8TJFD+AwPYK 3XdQ== 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=+yfEDmyLNIJ7O3kTqwFxss/QwPZU1eCcdBgpAodijIQ=; b=EY/jbsP2dG7Xj0O7RX5b5pVT3CaQlw6PS+0OnAMWlBCl7KX80/LEwgaq4a6GYQ/c1D OaOR8h9XjhivZBrYEYb8AZdMqx+mdAWTfLa7bRs+AtlCnFhqLlQtyBUyWYgS21zFC/tP U8OM3Ur9H1CkzeEoRy4o6re5p0/pqji4KxaZBkvhhWdht0mnz6hXz8Hv/mOE8JZtGTZN MIfJmZDqz67rzaDgNUxYcEqz6meD54JZE+5H1QpzEpkr8+6AcVosvAltN8N8djaHC6vs gD031odmVbLJ7m5aoDpBepXI5ixGDWlN4sLlj8MNG8vckCWaj1Soumw5NE2o72ovifmy W/2Q== X-Gm-Message-State: AOPr4FUITkJjm0pBsk/jNsxXQR8E7UzFClrd1/Tolcp8xucUmqKoTZoOYvWi0AO2zXsm/u4jbXRt77m2pvWLow== MIME-Version: 1.0 X-Received: by 10.28.30.148 with SMTP id e142mr2283804wme.69.1461313886605; Fri, 22 Apr 2016 01:31:26 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Fri, 22 Apr 2016 01:31:26 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Fri, 22 Apr 2016 01:31:26 -0700 (PDT) In-Reply-To: References: <571965D1.9020102@zend.com> Date: Fri, 22 Apr 2016 09:31:26 +0100 Message-ID: To: Dmitry Stogov Cc: PHP internals Content-Type: multipart/alternative; boundary=001a114b245a1dd7f005310ea7f0 Subject: Re: [PHP-DEV] [RFC] PHP Attributes From: codekestrel@googlemail.com (Dominic Grostate) --001a114b245a1dd7f005310ea7f0 Content-Type: text/plain; charset=UTF-8 I'm having a crack at it now. Seeing if I can use it to plug a new Annotation driver for Doctrine. Couple of things I've found so far are: <> with empty args doesn't work. <> namespace doesn't work. On the subject of using @, that could denote a class constructor, unless someone already mentioned that. On 22 Apr 2016 12:44 a.m., "Dmitry Stogov" wrote: On 04/22/2016 02:16 AM, Dominic Grostate wrote: This is amazing. It would actually allow us to implement our automated assertions ourselves, as opposed to requiring it within the language. this was the idea - to give a good tool instead of implementing every possible use-case in the language. Could it also support references? <> function foo($a) { } yes. "&$a" is a valid PHP expression. If you plan to use this, I would appreciate, if you to build the patched PHP and try it. The early we find problems the better feature we will get at the end. Thanks. Dmitry. On 21 Apr 2016 10:13 p.m., "Dmitry Stogov" wrote: > Hi, > > > I would like to present an RFC proposing support for native annotation. > > The naming, syntax and behavior are mostly influenced by HHVM Hack, but > not exactly the same. > > The most interesting difference is an ability to use arbitrary PHP > expressions as attribute values. > > These expressions are not evaluated, but stored as Abstract Syntax Trees, > and later may be accessed (node by node) in PHP extensions, preprocessors > and PHP scripts their selves. I think this ability may be useful for > "Design By Contract", other formal verification systems, Aspect Oriented > Programming, etc > > > https://wiki.php.net/rfc/attributes > > > Note that this approach is going to be native, in contrast to doc-comment > approach that uses not well defined syntax, and even not parsed by PHP > itself. > > > Additional ideas, endorsement and criticism are welcome. > > > Thanks. Dmitry. > --001a114b245a1dd7f005310ea7f0--