catches in try-catch blocks; variable syntax tweaks to resolve inconsistencies; support for named arguments; and support for trailing commas in parameter lists, which adds consistency with support for trailing commas in other contexts, such as in arrays. Standard library changes and additions Weak maps were added in PHP 8. A holds references to objects, but these references do not prevent such objects from being garbage collected. This can provide performance improvements in scenarios where data is being cached; this is of particular relevance for object relational mappings (ORM). Various adjustments to interfaces, such as adding support for creating objects from interfaces, and the addition of a interface that can be used for type hinting. Various new functions including str_contains(), str_starts_with(), and str_ends_with(); fdiv(); get_debug_type(); and get_resource_id() Object implementation of token_get_all() Additional changes Type annotations were also added into PHP's C source code itself to allow internal functions and methods to have "complete type information in reflection." Inheritance with private methods Abstract methods in traits improvements PHP 8.1 PHP 8.1 was released on December 8, 2021 and included a number of new features and improvements over previous versions. Here is a more detailed look at some of the key features and improvements in PHP 8.1: Union types: This feature allows you to specify that a variable can have multiple types, such as an integer or a string. This can be useful for writing more flexible and robust code, as it allows you to handle a wider range of input values. Nullsafe operator: This operator allows you to chain method calls without worrying about null references. For example, if you want to call a method on an object that may be null, you can use the nullsafe operator to ensure that the method is only called if the object is not null. Match expression: This is a more concise and flexible way to perform matching on values. It allows you to specify multiple cases and their associated values, and then use the match keyword to select the appropriate case based on the value of an expression. Improved performance: PHP 8.1 includes various performance improvements, such as faster array operations and better memory usage. These improvements can help make your code run faster and more efficiently. New error handling features: PHP 8.1 introduces a new throws keyword that allows you to specify which exceptions a function can throw, and a new assert() function