Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:83026 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 37212 invoked from network); 18 Feb 2015 07:02:37 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Feb 2015 07:02:37 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.213.45 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.213.45 mail-yh0-f45.google.com Received: from [209.85.213.45] ([209.85.213.45:42359] helo=mail-yh0-f45.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CE/82-18888-B0934E45 for ; Wed, 18 Feb 2015 02:02:35 -0500 Received: by yhoa41 with SMTP id a41so1724405yho.9 for ; Tue, 17 Feb 2015 23:02:32 -0800 (PST) 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:content-type; bh=gaGXZBLJHNjEGAG0fFR1BB8EhTY2vIaXn53E+g74Utc=; b=BbHHkgLpc12pqMhH0/kWYEDaXplPEa0V61On4Cy5u98u3fY15zpKg1IinQZT2mmrQX dgHo4qopa2vU6V5RF0o37ChM1zzZSv+96a5JfKhw24a73vrY/4jdL1YpPkT0pTQ/Ngqq ohNIs6R+9/SCnlGhfxzdB4AF8+v9iaTsbZaH7c/8bA+pWCeRT9NBfXigomUw5+RVlQQw x6lDzkee/XcqNisuyeLe+d7+3nqEAGEKQYh0vhafdPRGgjhkeYv15lLR6v/ZqwhMKjZd tTFGUYZZGUkUoJDP+dRO+fAzFF0lHuLF0lf1Rl+uAFzqhtQYbcJNP1hwy/tCbdqE3Z0o wkbA== X-Gm-Message-State: ALoCoQmN1BGF6Y4HWOj4imzW5goAX6WaCjruMCUKGwonPG8IM4NBIa+QzWsL8SWY1c7t5iOnywW9513PRRIVtHfy5ktRS5IvJLRXVLFS7t4bVxxKQ++8FsZTS+6UT4KoREQIdi5yymP7USRF4HUeHAwlNYatiRXefQ== MIME-Version: 1.0 X-Received: by 10.52.99.230 with SMTP id et6mr4949523vdb.65.1424242952613; Tue, 17 Feb 2015 23:02:32 -0800 (PST) Received: by 10.52.74.73 with HTTP; Tue, 17 Feb 2015 23:02:32 -0800 (PST) In-Reply-To: References: <02a101d04af9$507484f0$f15d8ed0$@php.net> Date: Wed, 18 Feb 2015 11:02:32 +0400 Message-ID: To: "guilhermeblanco@gmail.com" Cc: francois , Alexander Lisachenko , Nikita Popov , Benjamin Eberlei , PHP Internals , Pierrick CHARRON , Pierre Joye , Zeev Suraski , Andi Gutmans , Joe Watkins , Yasuo Ohgaki , Sebastian Bergmann , Stanislav Malyshev , Rasmus Lerdorf Content-Type: multipart/alternative; boundary=20cf3071c7c04439a5050f576739 Subject: Re: [PHP-DEV] Annotations in PHP7 From: dmitry@zend.com (Dmitry Stogov) --20cf3071c7c04439a5050f576739 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, Feb 18, 2015 at 12:51 AM, guilhermeblanco@gmail.com < guilhermeblanco@gmail.com> wrote: > Fran=C3=A7ois, > > Doctrine relies on nested annotations for a variety of mapping informatio= n. > One example: > > > http://doctrine-orm.readthedocs.org/en/latest/reference/association-mappi= ng.html#one-to-many-unidirectional-with-join-table > > Nested annotations are not going to be necessary, because they may be represented by PHP pseudo-syntax (and/or PHP array syntax) class User { ... } $r =3D new ReflectionClass("User"); $ast =3D $r->getAnnotation("Doctine_Join"); echo $ast->child[0]->child[0]; // "ManyToMany" echo $ast->child[0]->child[1]->child[0]->child[0]; // "$targetEntity" or If we provide API similar to SimpleXML echo $ast[0][0]; // "ManyToMany" echo $ast[0][1][0][0]; // "$targetEntity" Thanks. Dmitry. > []s, > > On Tue, Feb 17, 2015 at 4:33 PM, Fran=C3=A7ois Laupretre > wrote: > >> Hi Alexander, >> >> > De : Alexander Lisachenko [mailto:lisachenko.it@gmail.com] >> > >> > This RFC consists of two parts: parsing API and parser extension API. >> Last >> > one can be rejected, however it can be perfectly connected with >> annotation >> > RFC (if AST will be used as values) >> >> Parser extension API is great. Go on with it. I have a lot of uses in >> mind. >> >> > As for annotations, general use-case is appreciated. This can be >> extended >> > later in future versions of PHP. Therefore, annotation syntax should >> allow >> > to define key and values. Value can be valid expression (AST? concrete >> > node? compiled value?) or can recursively contain nested annotations. >> >> Can you give a use case for nested annotations ? I don't see what they >> can be needed for. >> >> Thanks >> >> Fran=C3=A7ois >> >> >> >> > > > -- > Guilherme Blanco > MSN: guilhermeblanco@hotmail.com > GTalk: guilhermeblanco > Toronto - ON/Canada > --20cf3071c7c04439a5050f576739--