php-8.0.30-src/ext/tokenizer/tests/token_get_all_TOKEN_PARSE_0...

20 lines
355 B
PHP

--TEST--
Parse errors during token_get_all() with TOKEN_PARSE flag
--SKIPIF--
<?php if (!extension_loaded("tokenizer")) print "skip"; ?>
--FILE--
<?php
try {
token_get_all('<?php invalid code;', TOKEN_PARSE);
} catch (ParseError $e) {
echo $e->getMessage(), PHP_EOL;
}
echo "Done";
?>
--EXPECT--
syntax error, unexpected identifier "code"
Done