1
0
mirror of https://github.com/php/php-src.git synced 2026-04-22 23:48:14 +02:00
Files
archived-php-src/ext/tokenizer/tests/PhpToken_extension.phpt
T
Nikita Popov 7485978339 Migrate SKIPIF -> EXTENSIONS (#7138)
This is an automated migration of most SKIPIF extension_loaded checks.
2021-06-11 11:57:42 +02:00

37 lines
524 B
PHP

--TEST--
Extending the PhpToken class
--EXTENSIONS--
tokenizer
--FILE--
<?php
$code = <<<'PHP'
<?PHP
FUNCTION FOO() {
ECHO "bar";
}
PHP;
class MyPhpToken extends PhpToken {
public int $extra = 123;
public function getLoweredText(): string {
return strtolower($this->text);
}
}
foreach (MyPhpToken::tokenize($code) as $token) {
echo $token->getLoweredText();
if ($token->extra !== 123) {
echo "Missing property!\n";
}
}
?>
--EXPECT--
<?php
function foo() {
echo "bar";
}