PHP 7.4 Is Available on All Virtual Hosting Plans

It was announced , that a new version of the blue elephant PHP 7.4.0 was released on the official website on the 28th of November, 2019. Version 7.4.3 was released on the 20th of February, 2020 . It's just the time to see what was added in version 7.4.

What's new?

Typed properties
Class properties support type declarations now.

Arrow functions
Arrow functions are a shortened entry for defining functions with an implicit binding of the parent visibility scope by value.

Limited covariance of the return type and contravariance of the argument type
Full support for variation is only available when using autorun. There can only be non-cyclic references inside a single file, since all classes must be defined before they can be referenced.

Unpacking inside the arrays.

Setting operator of joining with null.

Separator in numeric literals
Now numeric literals can have underscores between characters.

Weak references
Weak references allow the human programmer to save a reference to an object that does not prevent the garbage collector from deleting that object.

Handling exceptions from the __toString method()
Throwing exceptions from the __toString () method is allowed now. This led to a fatal error, previously. Existing fatal errors that are caught when converting an object to a string will be accessible as exceptions of the Error class.

Hash function

  • Was added a crc32c hash using the Castanoli polynomial. This implementation of the CRC32 algorithm is used by storage systems such as iSCSI, SCTP, Btrfs, and ext4.
  • Multibyte string
  • Was added the mb_str_split () function, which performs the same as str_split (), but works with code points, not with bytes

Was added support for preloading code.

Regular expressions (Perl compatible)
The preg_replace_callback() and preg_replace_callback_array() functions now accept an additional flags argument with support for the PREG_OFFSET_CAPTURE and PREG_UNMATCHED_AS_NULL flags. It will affect the format of the array of matched values passed to the callback function.

The user name and password can now be specified as part of the DSN for mysql, mssql, sybase, dblib, firebird and oci drivers. This was only supported for the pgsql driver previously. The constructor will have priority, if the user name/password is specified in both the constructor and the DSN.

You can also mask interrogation marks in SQL queries so that they are not perceived as named parameters now. Usage ?? sends a single interrogation mark to the database and, for example, if using PostgreSQL, will be used the key existence check operator in JSON (?).

Custom object serialization
Was added a new mechanism for serializing user objects using two new magic methods: __serialize and __unserialize. The new serialization mechanism replaces the Serializable interface, which will be deprecated in the future.

Functions for merging arrays without arguments
The array_merge() and array_merge_recursive() functions can now be called without any arguments, and then they will return an empty array. This is useful in conjunction with an extension operator, such as array_merge(... $ arrays ).

Proc_open() function
proc_open() now accepts an array instead of a string to execute the command. In this case, the process will be opened directly (without the command shell), and PHP will escape any necessary argument. The proc_open () function now supports redirect and null descriptors.

Outdated features

The following modules were removed from the standard delivery:

  • Firebird/Interbase
  • Recode
  • WDDX

We have not provided the entire list of innovations. You can learn more by yourself on the official website.

How to install PHP 7.4 in your hosting control panel

Next, we demonstrate how you can enable PHP 7.4 in your hosting control panel. As always, switching versions is just a couple of clicks away.

On the hosting control panel, go to the WWW section, then go to the WWW- domains subsection, from the list, select the domain where you plan to install PHP version 7.4 and click Change. In the window that appears, on the PHP Version line, select PHP 7.4.3 (alt) from the list.

Need reliable hosting?