Is there a hint like phpdoc for a boolean parameter?

I was unable to find an overview of the types that can be mapped using PHPDoc. I know an array or string, but is there also a bool? How:

/**
 * @param bool loadLazy
 * @return array Array with objects
 */
public function getObjects($loadLazy=false) {
+5
source share
4 answers

As a "type hint" is just a "hint", I would say that you can use almost anything you want.

However, I tend to use the types that are contained in the official PHP manual, which means that Boolean I will use boolean.

+10
source

, PHP , mixed. , | (, @param int|bool $var)

+6

, bool .

0
source

bool is supported in phpDocumentor and phpXref.

FROM.

0
source

All Articles