Documentation

ParserFactory
in package

Table of Contents

ONLY_PHP5  = 4
ONLY_PHP7  = 3
PREFER_PHP5  = 2
PREFER_PHP7  = 1
create()  : Parser
Creates a Parser instance, according to the provided kind.

Constants

Methods

create()

Creates a Parser instance, according to the provided kind.

public create(int $kind[, Lexer|null $lexer = null ][, array<string|int, mixed> $parserOptions = [] ]) : Parser
Parameters
$kind : int

One of ::PREFER_PHP7, ::PREFER_PHP5, ::ONLY_PHP7 or ::ONLY_PHP5

$lexer : Lexer|null = null

Lexer to use. Defaults to emulative lexer when not specified

$parserOptions : array<string|int, mixed> = []

Parser options. See ParserAbstract::__construct() argument

Return values
Parser

The parser instance

Search results