Tolerant Mode

Edit pageLast modified: 02 February 2025

The "tolerant" analysis mode allows parsing a type grammar containing other arbitrary data.

Such a mode will be convenient to use, for example, for analyzing phpdoc docblocks, separating types from their descriptions.

As an example, let's try to parse the contents of the " @return " docblock. Similar actions can be implemented for other annotations.

The Parser::$lastProcessedTokenOffset contains the offset in bytes (in this case 11) at which unparsable content begins (description of " @return " annotation).

The $description will contain: