Re: Annotation RFC + Patch

From: Date: Wed, 25 Aug 2010 16:04:11 +0000
Subject: Re: Annotation RFC + Patch
References: 1 2  Groups: php.internals 
Request: Send a blank email to internals+get-49518@lists.php.net to get a copy of this message
Hi Etienne, 2010/8/25 Etienne Kneuss <colder@php.net>: > On Aug 25  8:56:53, Pierrick Charron wrote: >> Hello PHP Internals! >> >> Recently a RFC was included on the PHP Wiki[1]. >> I know there've been a lot of buzz related to PHP 5.4, but this is not >> the subject of this email. >> >> I'm here to propose a new feature in PHP: Annotations. >> A patch is already available with 54 tests for the moment[2]. >> >> I worked together with Guilherme Blanco to make this support happen in >> a fresh PHP SVN trunk checkout. >> Please review, comment and provide feedback! I think it's a very >> useful support and may benefit users a lot. >> >> [1] http://wiki.php.net/rfc/annotations >> [2] http://www.adoy.net/php/Annotations.diff > > Quite interresting RFC! However, I've a few concerns/questions: > > 1) The new limitted syntax (esp. the field assignation). IMO this should > be extended to support more/all expressions. What kind of syntax would you like to add ? Right now you can add common static variables, array and Annotations. > > 2) How does it create the annotation? will it call __construct? If so, > Foo("asd") should defeinitely map to a constructor call, and the field > assignation should be discarded unless we have named parameters. Since php does not support named parameter the __construct is called with an array as parameter [Foo("bar", baz="baz)] will call __construct(array("value" => "bar", "baz" => "baz)); > > 3) What is the purpose of an aliased name? Aliased name ? > > Best, > >> >> Regards, >> Pierrick >> >> (Sorry if you receive this message twice but it looks like I have >> problems with the ML) >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> > > -- > Etienne Kneuss >

« previous php.internals (#49518) next »