New PHP Function Array_Is_List
An array is a data structure that stores values in order. It is possible to swap the keys and values of an associative array using the array_map() function. This can be useful for swapping the ordering of values in an array, and also allows for rearranging keyed data elements in an array.
A new php function called array_is_list checks whether a provided array is a list. It does this by checking the length of the array and the number of distinct elements. It also makes sure there are no missing array offsets, out-of-order keys, or other issues that can be difficult to spot in some cases.
One of the most interesting changes in this RFC is the addition of a new return type to PHP: never. When a function is declared to return never, it will not return any value and must end with a die or exit call (implicitly or explicitly). This change allows developers to easily identify functions that are not supposed to return any value and ensures they don’t accidentally modify $GLOBALS or break code.
Another cool addition is the ability to add a trailing comma at the end of a list of function arguments. This will make it easier to read and understand the parameters for a function.
Another great feature added is the readonly property for class methods, which provides a strong immutability guarantee for objects that are declared as readonly. This is a great way to reduce the amount of boilerplate code that developers often have to write to enable immutability.