Skip to content

Tag reference

@todo

The @todo tag records an unfinished piece of work related to the element it annotates, so that it can be tracked and picked up later instead of being forgotten as a stray code comment. Documentation generators and IDEs can collect every @todo across a codebase into a single worklist.

Grammar

"@todo" [ <Description> ]

Examples

Describing the outstanding work directly.
/**
* @todo Support cancellation once the transport exposes it.
*/
public function send(Message $message): bool
Referencing a tracking issue alongside the description.
/**
* @todo Validate recipient addresses before dispatch (see
* ISSUE-482).
*/

Names by platform

phpdocumentor
@todo

Parsing a @todo tag produces a TodoTag instance. Being a pure marker, it adds nothing beyond the $name and optional $description every Tag already carries — in practice the description is what gives the tag its value, since a bare @todo says nothing about what remains to be done.

final class TodoTag extends FlagTag {}

Defined by the PSR-19 draft (FIG proposed PHPDoc Tags, §5.16) and by phpDocumentor.