Changing the PHP Error Mode to PDO:ERRMODE_EXCEPTION
PHP tries to be smart when it parses code but sometimes mistakes can happen. In those cases it should show proper errors, not just warnings or notices. This rfc will change the default error mode to PDO::ERRMODE_EXCEPTION so it should be easier for developers to get more information about mistakes they made while writing code.
PHP inbuilt function token_get_all() parses source string into PHP language tokens using Zend engine lexical scanner. It can recognize some of the PHP keywords, some functions and identifiers like class names. It also recognizes HTML code, comments and composite symbols. However it misses out to parse some other tokens which are important for working with PHP code. For example it doesn't recognize arithmetic or bitwise operations on arrays, resources and objects. It also fails to recognize the class names of private methods.
To solve these issues a new class PhpToken is introduced in PHP 8.0. It's a higher level abstraction than the token_get_all() and provides a better support for working with PHP code. It has public properties like $token->id, $token->text, $token->line and $token->pos that return useful information about the token. It can be used to unify tokens and support other PHP features which are not supported by the standard tokenizer of PHP. It also provides a function get_debug_type which is similar to the PHP inbuilt function gettype() but returns more useful output for arrays, strings, anonymous classes and objects. The corresponding RFC details all of these features.