PHP TypeLang Help

@property-read

The @property-read tag declares a magic property that can only be read, never written: __get is expected to handle it, but __set should reject it (or simply doesn't exist). It is otherwise identical to @property — written on the class docblock, one line per property — and exists so that IDEs and static analyzers can flag an accidental assignment to a value that the class was never meant to accept.

"@property-read" <Type> <Variable> [ <Description> ]

Parsing a @property-read tag produces a TypedVariableTag instance exposing:

  • $type — the documented TypeNode.

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

final class PropertyReadTag extends MagicPropertyTag { // Inherits `$type` (computed `TypeNode` getter) // and `string $variable` (required, non-null) // from MagicPropertyTag; adds nothing of its own. }

Use @property instead when both directions are supported, or @property-write for the mirror case of a write-only property.

Defined by the same PSR-19 §5.11 section as @property, and phpDocumentor's own @property-read reference.

05 July 2026