views:

126

answers:

2

Hi, I'm creating a server library in PHP, and I was thinking to use annotations. I'm a Java developer and I use annotations intensively (also because it's a language feature). I know in PHP there are some annotation libraries, but nothing officially supported.

So, have you ever used annotations in your PHP project?

Thanks

A: 

Yes, it happens, but not so often. PHPUnit uses it heavily, and also modern frameworks: symfony (and doctrine), flow3. But mostly for advanced features, not often used by typical Joe Webmaster ;)

ts
+2  A: 

As far as I know annotations in any useful, run-time sense are not a standard feature of PHP at this moment, but certain frameworks and libraries utilise them (as ts has mentioned).

If you're looking for an equivalent to Javadoc however, there is PHPDoc. phpDocumentor is the 'standard' documentation generator, but there are others. Most PHP IDEs I've tried will use PHPDoc blocks for code completion and so on, so it is definitely worth doing.

Geoff Adams