PHP

Document your PHP code!

Over the weekend I was doing what most programmers hate more than a morning without coffee: I created documentation for some projects. Of course I used a tool for it, namely phpDocumentor.
So what does it do? In the beginning there was Java and it's famous JavaDoc tool. (Yes, I'll come back to PHP in a few sentences.) When writing Java code, you are encouraged to do some special (but trivial) markup in your comments. Then you run javadoc and get a nicely formatted documentation with class trees, variable reference and much more, all garnished with your code comments.
Obviously I'm not the only one who thinks this concept is as cinvincing as it is simple, and so are several software projects out there trying to do to other languages what JavaDoc does to Java.
For PHP, there seem to be two major candidates: PHPDoc and phpDocumentor. I chose the latter one because it produces better results with less efort in my case - YMMV. phpDocumentor understands tags specific to PHPDoc and has nearly the same tags as Doxygen. Doxygen is a congenial tool mainly for C, C++ and IDL. It can also document PHP, but the standard output of phpDocumentor looks nicer. Doxygen is more usefull in larger projects when you need nice generated diagrams.

Benchmarking PHP code

Syndicate content