The presented patch is just a quick and dirty work that I could put together in 2 days, with knowledge of the zend engine. Thanks to some tips from Pierrick, I'm slowly improving its quality.
However my ideal goals are pretty close to what you have done in your rfc. Today Pierrick added the possibility to annotate method parameters just like in the patch I sent, so I'm happy I already contributed with something ;) I made the patch for similar reasons. I'm the author of Ding (IoC/DI container) and I really dont like having to use doc blocks to support annotations. I think this is an increasing need generally speaking in the php world. If PHP is to be considered some kind of "agile" language, it needs some kind of metadata handling (in this case, annotations). I think other things can be added to the rfc, like having some annotations supported by php itself (@Init, @Destroy, @Configuration). This would need to be instantiated and "run" as soon as the annotation is detected. This could be accomplished by either php or c code, so the behavior can be extended via pecl extensions and/or normal php code. On Mon, Mar 14, 2011 at 3:02 PM, guilhermebla...@gmail.com <guilhermebla...@gmail.com> wrote: > Hi all, > > I promise myself to not revamp this discussion again, but it wasn't me > this time! > > @Etienne: That RFC is outdated. > Since the last feedback form internals list, a lot of changes have > been made to that RFC. Maybe I should update it ASAP so you can > clearly understand what have changed to be compatible with current PHP > syntax. > > If you are interested, Pierrick moved all the recent developments to a > github repository, which can be reached here: > https://github.com/adoy/PHP-Annotations > > Take a look at some tests: > https://github.com/adoy/PHP-Annotations/blob/master/tests/annotations/parser_021.phpt > https://github.com/adoy/PHP-Annotations/blob/master/tests/annotations/ReflectionParameter_getAnnotations_003.phpt > https://github.com/adoy/PHP-Annotations/blob/master/tests/annotations/ReflectionClass_getAnnotations_004.phpt > > Also, there's even an alternative patch that support positioned > parameters instead of named ones. > We just have to reach an agreement with what PHP core want. > > @Marcelo: While your proposal looks very good, it lacks of the support > to nested Annotation. > Consider how userland/framework would use your idea. For example, > Symfony2 supports validation of data inside classes inspired on > JSR-303 (Bean Validation). > > Symfony2 takes an advantage of a library Doctrine group (which I'm a > core member) created by parsing docblocks. When we created this > parser, I created this RFC with the good intention that PHP could > benefit of this known feature to enhance current userland > developments. > The first thing you need is your application still running ok with and > without comments. This already breaks all suggestions of creating a > PECL extension of docblock parser. > > > > I'd like to see what people think about it and make something "IN" on > next PHP major version. > > > > Cheers, > > On Sun, Mar 13, 2011 at 8:07 PM, Pierre Joye <pierre....@gmail.com> wrote: >> On Sun, Mar 13, 2011 at 11:02 PM, Marcelo Gornstein <marce...@gmail.com> >> wrote: >>>> I don't believe the patch was anywhere near an accepted state back then, >>>> sadly. >>> Are you saying there wont be annotations in PHP? Is there any way to >>> contribute to make this feature accepted and available? >> >> No, only that no compromise has been reached on annotation support. >> >> >> -- >> Pierre >> >> @pierrejoye | http://blog.thepimp.net | http://www.libgd.org >> >> -- >> PHP Internals - PHP Runtime Development Mailing List >> To unsubscribe, visit: http://www.php.net/unsub.php >> >> > > > > -- > Guilherme Blanco > Mobile: +55 (16) 9215-8480 > MSN: guilhermebla...@hotmail.com > São Paulo - SP/Brazil > -- -- // I don't sleep. I coffee. "Make everything as simple as possible, but not simpler." -- Albert Einstein "The class object inherits from Chuck Norris." "Chuck Norris can divide by zero and can unit test an entire application with a single assert." "There’s a lot of work happening behind the scenes, courtesy of the Spring AOP framework" "Why do I have this nagging hunch that you have no idea what you're doing?" "Any society that would give up a little liberty to gain a little security will deserve neither and lose both" - Benjamin Franklin -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php