PHP and autoloading · Question 8 of 12
Which character sequence starts a DocBlock comment in PHP?
1 answer is correct. Easy
Show answer
Answer
- A /**
Explanation
A DocBlock starts with /** (a slash and two asterisks) and ends with */, for example /** @var list<Item> */. Only this second asterisk tells IDEs, phpDocumentor and PHPStan that the comment contains documentation and tags such as @param or @return. A normal block comment with /* looks almost the same, but these tools do not treat it as a DocBlock. // and # start single-line comments; #[, however, has marked the beginning of an attribute since PHP 8.