@var
@var is the most flexible of the type tags: it documents the type of a property, a class constant, or — written inline, right above an assignment — a local variable at the point it is declared or reassigned. That last form is especially useful for narrowing a variable's type where PHP or a static analyzer would otherwise infer something too broad, such as right after decoding JSON or pulling a value out of an untyped array.
The variable name is optional and mainly exists to disambiguate which of several variables mentioned on the same line the type applies to; on a property or constant, where there is only ever one target, it is normally left out entirely.
Parsing a @var tag produces a VarTag instance exposing:
$type— the documentedTypeNode.$variable— the name after the type, without the leading$, ornullwhen none was written. Unlike @param, whose$variableis always present,@var's is nullable because the name is optional in the grammar.
Defined by the PSR-19 draft (FIG proposed PHPDoc Tags, §5.18) and by phpDocumentor.