# code-engine/0.4.1/vendor/nikic/php-parser/lib/PhpParser/Parser.php

Code Engine – PHP Snippets, AI Functions &amp; Automation for WordPress, version 0.4.1. 25 lines.

- Page: https://pluginprobe.com/plugins/code-engine/0.4.1/code/vendor/nikic/php-parser/lib/PhpParser/Parser.php
- Raw: https://pluginprobe.com/plugins/code-engine/0.4.1/raw/vendor/nikic/php-parser/lib/PhpParser/Parser.php
- Modified: 2024-12-27T01:13:06+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/code-engine/0.4.1/code/vendor/nikic/php-parser/lib/PhpParser/Parser.php#L10-L20`.

```php
<?php declare(strict_types=1);

namespace PhpParser;

interface Parser {
    /**
     * Parses PHP code into a node tree.
     *
     * @param string $code The source code to parse
     * @param ErrorHandler|null $errorHandler Error handler to use for lexer/parser errors, defaults
     *                                        to ErrorHandler\Throwing.
     *
     * @return Node\Stmt[]|null Array of statements (or null non-throwing error handler is used and
     *                          the parser was unable to recover from an error).
     */
    public function parse(string $code, ?ErrorHandler $errorHandler = null): ?array;

    /**
     * Return tokens for the last parse.
     *
     * @return Token[]
     */
    public function getTokens(): array;
}

```
