Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:92621 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 35396 invoked from network); 21 Apr 2016 23:16:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Apr 2016 23:16:23 -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.44 as permitted sender) X-PHP-List-Original-Sender: codekestrel@googlemail.com X-Host-Fingerprint: 74.125.82.44 mail-wm0-f44.google.com Received: from [74.125.82.44] ([74.125.82.44:37667] helo=mail-wm0-f44.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 17/0B-14036-64F59175 for ; Thu, 21 Apr 2016 19:16:22 -0400 Received: by mail-wm0-f44.google.com with SMTP id n3so1291751wmn.0 for ; Thu, 21 Apr 2016 16:16:22 -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=bqPzkJZKxiUGEGBxASS8+w4yWocf4CJmulhI9vU2uro=; b=BSYMaQuFJ4dcscvhi5Yamnl3FvEW5iNr6e8tnLjFk6DTIxUUn76x5RE2eG/A/ugd8+ O6bpDO69IOkhAoORCcDBMYKhtcd7YgFXpsLmQn8fKlb2e8dMK/my8/HXK6Y5SbuTXTh8 fZAvk9cBkNzTngktxctIXR8Ba275jlGvQLnNebS2Ai5rLs1Tnkg+OMf41ACBEAa+fOWX Sm8MoQCSrDcgB7VGXzhnt7X+NpyxBw1yHh22y+I/V/Jbc8tBdjXQqIIu+HkKT02WDqqd JNWaDU5WSIeGqLp2XOQPgC+z7krjAFlkVjT0bipRslmdS70ru/7U7fIbAwvb0JOAvo3B HW/Q== 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=bqPzkJZKxiUGEGBxASS8+w4yWocf4CJmulhI9vU2uro=; b=kswafs2JDj3H9fHuWXyu91M5r3TfCGem6DXSDmj2YHaDM+3Z9VSK2RWL6dINZQFtY5 vTym4TuqZhBNLZikcc9G41HqLx6JUVnZsgLoFox76CodsGrdQSRVe5uElc5VbHW2Hulc JaVUrok+wKT8jaKuQixMnWgNE4GAl/0XUpxcR6fKGLcvuO4NouhuC6l/DykaSnvTJx5h VoNRKzI46vFLdZroQ9lFjeNgQvYcDtHRMnvmNaOiZw/eL2esQ1b9w3f/m28XSx6dzeiK vLoqqL8/54lE/H6bKuFnwlVjK6qVXIaNu81vIzeMF8AKExfYqMpbO6fXE7/LjmfWK052 O86A== X-Gm-Message-State: AOPr4FXm7gWjXeFnRSXKhS7p714f4xShKUhhoT3Uo31YbbtXbS59Zcw/Kxhjl1firvlGpJJq7Z0T97coTsx/HQ== MIME-Version: 1.0 X-Received: by 10.194.96.10 with SMTP id do10mr19591595wjb.113.1461280579711; Thu, 21 Apr 2016 16:16:19 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Thu, 21 Apr 2016 16:16:19 -0700 (PDT) Received: by 10.28.140.10 with HTTP; Thu, 21 Apr 2016 16:16:19 -0700 (PDT) In-Reply-To: References: Date: Fri, 22 Apr 2016 00:16:19 +0100 Message-ID: To: Dmitry Stogov Cc: PHP internals Content-Type: multipart/alternative; boundary=047d7beba2b0defe17053106e583 Subject: Re: [PHP-DEV] [RFC] PHP Attributes From: codekestrel@googlemail.com (Dominic Grostate) --047d7beba2b0defe17053106e583 Content-Type: text/plain; charset=UTF-8 This is amazing. It would actually allow us to implement our automated assertions ourselves, as opposed to requiring it within the language. Could it also support references? <> function foo($a) { } 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. > --047d7beba2b0defe17053106e583--