PHP TypeLang Help

Generic Types

Each type can take arguments containing other type declarations. Validation of arguments and their number lies on the implementing side; the parser does not limit their number or nesting and does not check their semantic correctness in any way.

Each argument is enclosed in triangle brackets < and > and separated by a comma (,).

Call-Site Hints

Each template argument allows you to define an additional hint, which can be used, for example, in static analyzers to indicate the call-site variance.

List Syntax

In addition to modern list declarations such as list<int> or array<array-key, int>, the legacy int[] syntax is allowed.

Attributes

Each template argument allows you to define list of additional attributes. An attribute is additional metadata for an argument.

03 February 2025