PHP 7.1.12 Released

New features

New object type

A new type, object, has been introduced that can be used for (contravariant) parameter typing and (covariant) return typing of any objects.


function test(object $obj) : object
    return new 

test(new StdClass());

Extension loading by name

Shared extensions no longer require their file extension (.so for Unix or .dll for Windows) to be specified. This is enabled in the php.ini file, as well as in the dl() function.

Allow abstract method overriding

Abstract methods can now be overridden when an abstract class extends another abstract class.


abstract class A
    abstract function 
test(string $s);
abstract class 
extends A
// overridden - still maintaining contravariance for parameters and covariance for return
abstract function test($s) : int;

Password hashing with Argon2

Argon2 has been added to the password hashing API (the password_ functions), where the following constants have been exposed:


Extended string types for ext/PDO

PDO's string type has been extended to support the national character type when emulating prepares. This has been done with the following constants:


These constants are utilised by bitwise OR'ing them with PDO::PARAM_STR:



Additional emulated prepares debugging information for ext/PDO

The PDOStatement::debugDumpParams() method has been updated to include the SQL being sent to the DB, where the full, raw query (including the replaced placeholders with their bounded values) will be shown. This has been added to aid with debugging emulated prepares (and so it will only be available when emulated prepares are turned on).

Support for extended operations in ext/LDAP

Support for EXOP has been added to the LDAP extension. This has been done by exposing the following functions and constants:

  • ldap_parse_exop()
  • ldap_exop()
  • ldap_exop_passwd()
  • ldap_exop_whoami()

Address Information Additions to ext/sockets

The sockets extension now has the ability to lookup address information, as well as connect to it, bind to it, and explain it. The following four functions have been added for this:

  • socket_addrinfo_lookup()
  • socket_addrinfo_connect()
  • socket_addrinfo_bind()
  • socket_addrinfo_explain()

Parameter type widening

Parameter types from overridden methods and from interface implementations may now be omitted. This is still in compliance with LSP, since parameters types are contravariant.


interface A
    public function 
Test(array $input);

implements A
    public function 
Test($input){} // type omitted for $input

Allow a trailing comma for grouped namespaces

A trailing comma can now be added to the group-use syntax introduced in PHP 7.0.


use Foo\Bar\{
add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top