On Mon, 13 Sep 2010 17:28:47 +0200, Zeev Suraski <z...@zend.com> 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 -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php