PHP 7.1

PHP is a popular general-purpose scripting language that is especially suited to web development.

Fast, flexible and pragmatic. This is a bugfix release, with several bug fixes included.it is a general-purpose scripting language that is especially suited to server-side web development, in which case PHP generally runs on a web server. Any PHP code in a requested file is executed by the PHP runtime, usually to create dynamic web page content or dynamic images used on websites or elsewhere.

Nullable Type

The above feature uses c# and java. And now also in php. It returns null from a function.

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.

Symmetric Array Destructuring

The shorthand array syntax ([]) may now be used to destructure arrays for assignments (including within for each), as an alternative to the existing list () syntax, which is still supported.

Class Constant Visibility

Access modifiers with a constant variable can now be used within the class, Support for specifying the visibility of class constants has been added.

Iterable Pseudo-Type

A new pseudo-type 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

You can catch one or more exceptions at a time from a single catch.

Support for Keys In list()

Keys can now be specified while a list is created using either the list() function or the new shorthand syntax, such as ([]) . This enables destructuring of arrays with non-integer or non-sequential keys.

Support for Negative String Offsets

negative string offsets has is 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.

Convert Callables to Closures

A new static method has been introduced to the Closure class to allow for callables to be easily converted into Closure objects.

Asynchronous Signal Handling

A new function called pcntl_async_signals() has been introduced to enable asynchronous signal handling. New function also reduces overhead using ticks.

HTTP/2 server push support in ext/curl

HTTP/2 push can now be used using ext/curl. The following new constants have been added for curl_multi_setopt() in PHP7.1:

  • CURLMOPT_PUSHFUNCTION
  • CURL_PUSH_DENY
  • CURL_PUSH_OK.

Conclusion

This is  a summary of some of the major updates and changes in PHP 7.1,. If you would like to discuss your requirements or you have any other questions, then please let us know.

Leave a Reply

Your email address will not be published. Required fields are marked *