PHP TypeLang Help

@param

The @param tag documents a single argument of a function or method: the type of value it accepts, and — since PHP's own type hints cannot express everything a docblock can (a shape, a generic, a literal, a conditional type) — often more precisely than the function's native signature does.

"@param" <Type> <Variable> [ <Description> ]

The type is parsed using the full TypeLang grammar, so anything documented elsewhere in this reference — a shape, a generic, a conditional type — is equally valid here.

Parsing a @param tag produces a ParamTag instance exposing:

  • $type — the documented TypeNode.

  • $variable — the parameter's name, without the leading $.

final class ParamTag extends TypedVariableTag { // Inherits a computed `TypeNode $type` getter and // `string $variable` from TypedVariableTag, plus // `$name` and `$description` from the base `Tag` // class; adds nothing of its own. }

One @param tag is expected per documented argument, each naming the argument it describes; the order of the tags in the comment does not have to match the order of the arguments in the signature.

Defined by PSR-19 §5.10 — FIG's proposed PHPDoc tags standard — and phpDocumentor's own @param reference.

05 July 2026