Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:64728 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 88956 invoked from network); 9 Jan 2013 12:03:32 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 9 Jan 2013 12:03:32 -0000 Authentication-Results: pb1.pair.com smtp.mail=g.b.yahav@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=g.b.yahav@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.219.41 as permitted sender) X-PHP-List-Original-Sender: g.b.yahav@gmail.com X-Host-Fingerprint: 209.85.219.41 mail-oa0-f41.google.com Received: from [209.85.219.41] ([209.85.219.41:42321] helo=mail-oa0-f41.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/E3-02684-39C5DE05 for ; Wed, 09 Jan 2013 07:03:31 -0500 Received: by mail-oa0-f41.google.com with SMTP id k14so897510oag.0 for ; Wed, 09 Jan 2013 04:03:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=dGki8N8/zsjbJtWz79rMOgxMprd7ilc5mq0l7atWDK4=; b=WF7CG0VLBktnMuhUeElwHutthf7AQMk3QbmBBWdWs33dQ0IKDl0921kuA47tCFl8WE P8MAB/NHbnBMpEH5R51QK0yCFNrEE8ND8cwtCth8SL5Pb43tuBvL19Nkk1Z5oo/EQ6GR um7vnTXfmvnwi9GNgAaw9Cuco9FT+Q6ktmCybi6oXbIBj7GK/8xZ6TdWC5ybunmeW0gK 1SettURC9fvbm7MButR2Y1d5TUWAVTeXci4yvv//aCbDAJIooxMSXSJ7L07nAR8xfvrV FtwayawWcX0pKib6mNbpInSJjkYLWtm7r1sft6Rz92v5V7DVd9+a2mWh0db8Fb/QoAsX YYRg== Received: by 10.182.235.46 with SMTP id uj14mr47532045obc.40.1357733009038; Wed, 09 Jan 2013 04:03:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.76.151.4 with HTTP; Wed, 9 Jan 2013 04:03:08 -0800 (PST) In-Reply-To: <9f792e7e11c481c5f4c62ce69ae216b6@mohiva.com> References: <50ED4C18.3090806@zerocue.com> <9f792e7e11c481c5f4c62ce69ae216b6@mohiva.com> Date: Wed, 9 Jan 2013 14:03:08 +0200 Message-ID: To: Christian Kaps Cc: PHP internals Content-Type: multipart/alternative; boundary=14dae93b6024b41cac04d2d9d96f Subject: Re: [PHP-DEV] - True Annotations From: g.b.yahav@gmail.com (Yahav Gindi Bar) --14dae93b6024b41cac04d2d9d96f Content-Type: text/plain; charset=ISO-8859-1 On Wed, Jan 9, 2013 at 1:57 PM, Christian Kaps wrote: > Hi, > > > I agree here, I think the above, if possible would be best. In my >> mind annotations should proabably be limited in scope to class >> declarations and thus only before a class keyword, before a property >> or method declaration. >> >> In none of those scopes would [ ] be a parsing issue I believe... >> >> The one case would be at the beginning of a class, but if simply >> added something such as: >> [:SomeAttribute(xyz,abc),**SomeAttribute2] >> >> It could never be confused with short array syntax and is still brief. >> > > I think when implementing real annotations, then it should be possible to > declare arrays in it. So I think the square brackets don't work. > [Foo([1,2,3])] > > Cheers, > Christian > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > But the colon prefix won't cover this case? You can, as I've mentioned in my post at the doc-block parser discussion, use a keyword inside the brackets to symbolize annotation, for example [metadata: Key] [metadata: MaxLength(10)] [metadata: Relations(["foo", "bar", "baz"])] public $id; --14dae93b6024b41cac04d2d9d96f--