PHPDoc is an adaptation of Javadoc for the PHP programming language. It is still an informal standard for commenting PHP code, but it is in the progress of being formalized. It allows external document generators like phpDocumentor to generate documentation of APIs and helps some IDEs such as Zend Studio, NetBeans, JetBrains PhpStorm, ActiveState Komodo Edit and IDE, PHPEdit and Aptana Studio to interpret variable types and other ambiguities in the loosely typed language and to provide improved code completion, type hinting and debugging.
Try for example to use an IDE like PHPStorm and write the following PHP code:
/**
* @param array $test
*/
function mytest($test) {
// ... nothing here
}
Now when you start typing myte
you get the autocompletion to suggest mytest(test : array)
.
As you can see now PHPStorm knows the type of the $test
variable thanks to the PHPDoc above.