In PHP 7.3 onwards, CompileError exception has been added. This class inherits Error class. Some error conditions that previously resulted in fatal error, now throw a CompileError. This affects compilation errors that are likely to be thrown by token_get_all() function.
The token_get_all() function uses Zend lexical scanner to parse a given string into PHP language tokens.
token_get_all ( string $source [, int $flags = 0 ] ) : array
|Sr.No||Parameter & Description|
PHP source to parse
TOKEN_PARSE - Recognises the ability to use reserved words in specific contexts.
The function should be used in TOKEN_PARSE mode to be able to raise CompileError.