Stable Release in branch 5.6
5.6.40
Released 10 Jan 2019
(7 years ago)
SoftwarePHP
Version5.6
Status
End of life
Initial release5.6.0
28 Aug 2014
(11 years ago)
Latest release5.6.40
10 Jan 2019
(7 years ago)
End of bug fixes31 Dec 2017
(Ended 8 years ago)
End of security fixes31 Dec 2018
(Ended 7 years ago)
Release noteshttps://www.php.net/ChangeLog-5.php#5.6.40
Source codehttps://github.com/php/php-src/tree/php-5.6.40
Documentationhttps://www.php.net/manual/en/
Downloadhttps://www.php.net/releases/5.6.40
PHP 5.6 ReleasesView full list

What Is New in PHP 5.6

Category Key Changes
New Features Constant scalar expressions, variadic functions, argument unpacking, exponentiation operator, __debugInfo() magic method, use function and use const
Improvements GMP operator overloading, file uploads larger than 2GB, better SSL/TLS defaults
Deprecated mysql_* functions, call_user_method() and call_user_method_array(), mcrypt_generic_end()
Security OpenSSL improvements, default_charset option

What new language features were introduced?

PHP 5.6 added several syntactic enhancements that make code more expressive and concise. You can now use constant scalar expressions in contexts like array keys and property declarations, which is handy for defining values based on simple calculations.

Variadic functions and argument unpacking with the ... operator simplify working with variable numbers of arguments. This replaces the old pattern of using func_get_args() and makes the intent clearer at the function signature.

// Variadic function
function sum(...$numbers) {
    return array_sum($numbers);
}
// Argument unpacking
$args = [2, 3];
echo pow(2, ...$args); // 8

The exponentiation operator ** provides a shorthand for mathematical power operations. The new __debugInfo() magic method allows objects to control their output when printed with var_dump().

How did imports change with use function and use const?

PHP 5.6 extended the use keyword to support importing functions and constants from namespaces. This helps avoid writing fully qualified names repeatedly, making code less verbose.

use function Namespace\functionName;
use const Namespace\CONST_NAME;

In practice, this is a quality-of-life improvement for code organization. It encourages better structure by making it easier to use individual components from namespaces without resorting to global aliases.

What improvements were made for developers?

The GMP extension gained operator overloading, allowing you to use arithmetic operators directly on GMP objects instead of calling functions like gmp_add(). This makes mathematical code with large integers much more readable.

PHP now supports file uploads larger than 2GB, which was a longstanding limitation. The php.ini settings post_max_size and upload_max_filesize can handle values greater than 2GB.

SSL/TLS defaults were improved to enable peer verification by default and support certificate fingerprint verification. This matters because it pushes developers toward more secure out-of-the-box configurations for network operations.

What was deprecated and why?

The old mysql_* functions were officially deprecated in favor of MySQLi or PDO_MySQL. This was the final push to move developers away from the outdated extension that lacked modern features like prepared statements.

call_user_method() and call_user_method_array() were deprecated in favor of call_user_func() and call_user_func_array(). The deprecated functions were just aliases that added unnecessary complexity to the language.

mcrypt_generic_end() was deprecated in favor of mcrypt_generic_deinit(), which had a clearer name. The mcrypt extension itself was already on its way out due to better alternatives becoming available.

FAQ

Should I upgrade from PHP 5.5 to 5.6?
Yes, the upgrade is relatively smooth and brings worthwhile language improvements. The new syntax features like variadic functions and the exponentiation operator can make your code cleaner. Just be prepared to address any deprecated function usage.

How do I handle the deprecated mysql extension?
Migrate to either MySQLi or PDO_MySQL. Both offer prepared statements which are more secure. The conversion is straightforward but requires testing since the APIs are different.

What's the benefit of the exponentiation operator?
It provides a cleaner syntax for power operations. Instead of writing pow(2, 3), you can now use 2 ** 3. It's a small change that improves readability for mathematical code.

Can I really upload files larger than 2GB now?
Yes, this limitation was removed. You'll need to ensure both post_max_size and upload_max_filesize in your php.ini are set to values greater than 2GB to take advantage of this.

What does the __debugInfo() method do?
It allows objects to control which properties are shown when var_dump() is called on them. You can use it to hide sensitive data or format debug output more usefully.

Releases In Branch 5.6

VersionRelease date
5.6.4010 Jan 2019
(7 years ago)
5.6.3906 Dec 2018
(7 years ago)
5.6.3813 Sep 2018
(7 years ago)
5.6.3719 Jul 2018
(8 years ago)
5.6.3626 Apr 2018
(8 years ago)
5.6.3529 Mar 2018
(8 years ago)
5.6.3401 Mar 2018
(8 years ago)
5.6.3304 Jan 2018
(8 years ago)
5.6.3226 Oct 2017
(8 years ago)
5.6.3106 Jul 2017
(9 years ago)
5.6.3019 Jan 2017
(9 years ago)
5.6.2908 Dec 2016
(9 years ago)
5.6.2810 Nov 2016
(9 years ago)
5.6.2713 Oct 2016
(9 years ago)
5.6.2615 Sep 2016
(9 years ago)
5.6.2518 Aug 2016
(9 years ago)
5.6.2421 Jul 2016
(10 years ago)
5.6.2323 Jun 2016
(10 years ago)
5.6.2226 May 2016
(10 years ago)
5.6.2128 Apr 2016
(10 years ago)
5.6.2031 Mar 2016
(10 years ago)
5.6.1903 Mar 2016
(10 years ago)
5.6.1804 Feb 2016
(10 years ago)
5.6.1707 Jan 2016
(10 years ago)
5.6.1626 Nov 2015
(10 years ago)
5.6.1529 Oct 2015
(10 years ago)
5.6.1401 Oct 2015
(10 years ago)
5.6.1303 Sep 2015
(10 years ago)
5.6.1206 Aug 2015
(11 years ago)
5.6.1110 Jul 2015
(11 years ago)
5.6.1011 Jun 2015
(11 years ago)
5.6.914 May 2015
(11 years ago)
5.6.816 Apr 2015
(11 years ago)
5.6.719 Mar 2015
(11 years ago)
5.6.619 Feb 2015
(11 years ago)
5.6.522 Jan 2015
(11 years ago)
5.6.418 Dec 2014
(11 years ago)
5.6.313 Nov 2014
(11 years ago)
5.6.216 Oct 2014
(11 years ago)
5.6.102 Oct 2014
(11 years ago)
5.6.028 Aug 2014
(11 years ago)