php-src/ext/tokenizer/tokenizer.stub.php
Nikita Popov 5a09b9fb0f Add PhpToken class
RFC: https://wiki.php.net/rfc/token_as_object

Relative to the RFC, this also adds a __toString() method,
as discussed on list.

Closes GH-5176.
2020-03-26 11:09:18 +01:00

21 lines
562 B
PHP

<?php
function token_get_all(string $source, int $flags = 0): array {}
function token_name(int $token): string {}
class PhpToken implements Stringable {
/** @return static[] */
public static function getAll(string $code, int $flags = 0): array;
public final function __construct(int $id, string $text, int $line = -1, int $pos = -1);
/** @param int|string|array $kind */
public function is($kind): bool;
public function isIgnorable(): bool;
public function getTokenName(): ?string;
public function __toString(): string;
}