New features Nullable types Type declarations for parameters and return values can now be marked as nullable by prefixing the type name with a question mark. This signifies that as well as the specified type, &null; can be passed as an argument, or returned as a value, respectively. &example.outputs; Void functions A void return type has been introduced. Functions declared with void as their return type must either omit their return statement altogether, or use an empty return statement. &null; is not a valid return value for a void function. &example.outputs; Attempting to use a void function's return value simply evaluates to &null;, with no warnings emitted. The reason for this is because warnings would implicate the use of generic higher order functions. Symmetric array destructuring The shorthand array syntax ([]) may now be used to destructure arrays for assignments (including within foreach), as an alternative to the existing list syntax, which is still supported. Class constant visibility Support for specifying the visibility of class constants has been added. <type>iterable</type> pseudo-type A new pseudo-type (similar to callable) called iterable has been introduced. It may be used in parameter and return types, where it accepts either arrays or objects that implement the Traversable interface. With respect to subtyping, parameter types of child classes may broaden a parent's declaration of array or Traversable to iterable. With return types, child classes may narrow a parent's return type of iterable to array or an object that implements Traversable. Multi catch exception handling Multiple exceptions per catch block may now be specified using the pipe character (|). This is useful for when different exceptions from different class hierarchies are handled the same. Support for keys in <function>list</function> You can now specify keys in list, or its new shorthand [] syntax. This enables destructuring of arrays with non-integer or non-sequential keys. 1, "name" => 'Tom'], ["id" => 2, "name" => 'Fred'], ]; // list() style list("id" => $id1, "name" => $name1) = $data[0]; // [] style ["id" => $id1, "name" => $name1] = $data[0]; // list() style foreach ($data as list("id" => $id, "name" => $name)) { // logic here with $id and $name } // [] style foreach ($data as ["id" => $id, "name" => $name]) { // logic here with $id and $name } ]]> Support for negative string offsets Support for negative string offsets has been added to the string manipulation functions accepting offsets, as well as to string indexing with [] or {}. In such cases, a negative offset is interpreted as being an offset from the end of the string. &example.outputs; Negative string and array offsets are now also supported in the simple variable parsing syntax inside of strings. ]]> &example.outputs; Support for AEAD in ext/openssl Support for AEAD (modes GCM and CCM) have been added by extending the openssl_encrypt and openssl_decrypt functions with additional parameters. Convert callables to <classname>Closure</classname>s with <methodname>Closure::fromCallable</methodname> A new static method has been introduced to the Closure class to allow for callables to be easily converted into Closure objects. exposeFunction(); $privFunc('some value'); ]]> &example.outputs; Asynchronous signal handling A new function called pcntl_async_signals has been introduced to enable asynchronous signal handling without using ticks (which introduce a lot of overhead). &example.outputs; HTTP/2 server push support in ext/curl Support for server push has been added to the CURL extension (requires version 7.46 and above). This can be leveraged through the curl_multi_setopt function with the new CURLMOPT_PUSHFUNCTION constant. The constants CURL_PUSH_OK and CURL_PUSH_DENY have also been added so that the execution of the server push callback can either be approved or denied. Stream Context Options The tcp_nodelay stream context option has been added.