1--TEST--
2Extending the PhpToken class
3--EXTENSIONS--
4tokenizer
5--FILE--
6<?php
7
8$code = <<<'PHP'
9<?PHP
10FUNCTION FOO() {
11    ECHO "bar";
12}
13PHP;
14
15class MyPhpToken extends PhpToken {
16    public int $extra = 123;
17
18    public function getLoweredText(): string {
19        return strtolower($this->text);
20    }
21}
22
23foreach (MyPhpToken::tokenize($code) as $token) {
24    echo $token->getLoweredText();
25
26    if ($token->extra !== 123) {
27        echo "Missing property!\n";
28    }
29}
30
31?>
32--EXPECT--
33<?php
34function foo() {
35    echo "bar";
36}
37