Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49621 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 5356 invoked from network); 13 Sep 2010 15:47:15 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 13 Sep 2010 15:47:15 -0000 Authentication-Results: pb1.pair.com smtp.mail=kontakt@beberlei.de; spf=permerror; sender-id=unknown Authentication-Results: pb1.pair.com header.from=kontakt@beberlei.de; sender-id=unknown Received-SPF: error (pb1.pair.com: domain beberlei.de from 87.230.78.165 cause and error) X-PHP-List-Original-Sender: kontakt@beberlei.de X-Host-Fingerprint: 87.230.78.165 www.mysqlusers.de Linux 2.5 (sometimes 2.4) (4) Received: from [87.230.78.165] ([87.230.78.165:41023] helo=beberlei.de) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id A3/E2-24501-3874E8C4 for ; Mon, 13 Sep 2010 11:47:15 -0400 Received: by beberlei.de (Postfix, from userid 33) id 163D625A008E; Mon, 13 Sep 2010 17:47:12 +0200 (CEST) To: X-PHP-Originating-Script: 1000:func.inc MIME-Version: 1.0 Date: Mon, 13 Sep 2010 17:47:11 +0200 In-Reply-To: <7.0.1.0.2.20100913172559.0d2277d0@zend.com> References: <4C873C0F.1010200@zend.com> <4C879613.7090709@zend.com> <4C887D2B.2000605@zend.com> <4C8AC526.7000505@sugarcrm.com> <4C8B6168.30504@mohiva.com> <4C8BC81E.8000605@sugarcrm.com> <7.0.1.0.2.20100913145703.0d226d90@zend.com> <7.0.1.0.2.20100913172559.0d2277d0@zend.com> Message-ID: <562c6581919d7d3e11c4a24ebbdb9ac1@beberlei.de> X-Sender: kontakt@beberlei.de User-Agent: RoundCube Webmail/0.3.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PHP-DEV] Re: PHP Annotations RFC + Patch From: kontakt@beberlei.de (Benjamin Eberlei) On Mon, 13 Sep 2010 17:28:47 +0200, Zeev Suraski wrote: > At 16:39 13/09/2010, Pierre Joye wrote: >>You are not serioulsy suggesting to use phpdoc for runtime annotation >>support? Are you? > > I actually am (either that or get what you want done in some other > way). It's a rare enough use case that I think it's a very > reasonable compromise. The disadvantages of adding a whole new > branch of syntax, for this rare use case, far outweigh its advantages - > IMHO. This only applies to the weird suggestions of % or ! for the operator and new syntax constructs for arrays and such. Are there any objections to implementing them to actually look like PHP code? The only new syntantic sugar would be the [] and the implicit "new" keyword in the "annotClassName". annotation := [annotClassName(classArgs*)] classArgs := array | string | int | float | ... -- [ExpectedException("InvalidArgumentException")] [ExpectedException("InvalidArgumentException", "Expected message", 40")] [Validation(array("type" => "EMail", "options" => array("checkMX" => true))] -- new ExpectedException("InvlaidArgumentException") new Validation(array("type" => "EMail", "options" => array("checkMX" => true)) given this syntax (which the current patch nearly implements) i don't get the "whole new syntax" argument, this looks very much like PHP. greetings, Benjamin