PHP 5.6, released on August 28, 2014, added language features such as constant scalar expressions, variadic functions, argument unpacking, and exponentiation, alongside runtime and library updates. For developers maintaining or upgrading older PHP applications, the key distinction is that most new syntax is opt-in, while changes to JSON parsing and TLS verification can affect existing code.
What changed in PHP 5.6?
The changes fall into two useful groups: syntax that lets developers express code more directly, and runtime or library changes that add capabilities or alter existing behavior. The PHP Development Team described the release as bringing “new features, some backward incompatible changes and many improvements.” (PHP 5.6.0 release announcement)
Language features
Constant scalar expressions and constant arrays
PHP 5.6 allows expressions built from scalar literals and constants in contexts that previously required a static value, including constant declarations, property declarations, and default function arguments. This can express simple compile-time relationships without repeating literals; it does not permit arbitrary runtime calculations in those locations.
The const syntax can also define constant arrays. These changes are useful when a fixed value is assembled from other known values and should remain constant. (PHP manual: New features in PHP 5.6)
#1 Best Overall
Variadic functions and argument unpacking
PHP 5.6 uses the ellipsis syntax in two related but distinct ways:
- Variadic parameter: In a function definition,
...$paramscollects remaining arguments into an array. It can replace some uses offunc_get_args()and makes the function’s acceptance of extra arguments visible in its signature. Required and optional parameters can come before the variadic parameter. - Argument unpacking: At a call site,
...before an array orTraversablevalue passes its elements as individual arguments. This is a caller-side convenience; it does not collect arguments inside the called function.
Together, these features make it easier to pass through a variable number of arguments, while keeping the distinction between supplying arguments and receiving them clear. (PHP manual: New features in PHP 5.6)
Rank #2
Exponentiation
The ** operator performs exponentiation, and **= provides compound assignment. Exponentiation is right-associative: 2 ** 3 ** 2 evaluates as 2 ** (3 ** 2), or 512. That association matters when reading chained expressions. (PHP manual: New features in PHP 5.6)
Importing namespaced functions and constants
Namespace imports gained use function and use const, allowing functions and constants to be imported alongside classes. This makes namespaced code easier to refer to without repeating fully qualified names. (PHP manual: New features in PHP 5.6)
The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Runtime and library additions
- phpdbg: PHP 5.6 introduced phpdbg, an interactive debugger SAPI.
- Reusable request input: The
php://inputstream can be read more than once. - Constant-time comparison:
hash_equals()compares strings in constant time and is intended to help mitigate timing attacks when comparing secret-derived values. It does not, by itself, make an application secure. - Large file uploads: The release announcement lists support for uploads larger than 2 GB as a capability; this is not an adoption or performance statistic.
- GMP: GMP gained operator overloading.
- PostgreSQL: The release added asynchronous connection and query support.
These additions vary in scope: some are tools or APIs developers opt into, while others may matter when an application uses the relevant extension or stream. (PHP 5.6.0 release announcement; PHP manual: New features in PHP 5.6)
Character-encoding defaults
PHP 5.6 uses default_charset as the default encoding for htmlentities(), html_entity_decode(), and htmlspecialchars(); the default value is UTF-8. The manual notes that deprecated iconv and mbstring encoding settings take precedence for functions in their respective extensions. Applications relying on implicit encoding behavior should check their configuration and output. (PHP manual: New features in PHP 5.6)
Rank #4
What to review when migrating from PHP 5.5
PHP’s migration guidance says most improvements do not affect existing code, but it also documents incompatibilities and recommends testing before changing production versions. Prioritize the following areas if your application uses them:
- JSON:
json_decode()applies stricter syntax parsing. - SSL/TLS streams: Peer-certificate and host-name verification are enabled by default. Check whether the certificates and host names used by your application satisfy verification.
- GMP: GMP values change from resources to objects, which may affect code that checks or handles their former type.
- mcrypt: Functions require valid keys and initialization vectors (IVs).
- Class property array literals: The compatibility guidance documents changed array-key behavior that warrants review where such literals are used.
These are targeted checks, not evidence that every PHP 5.5 application will break. Compare the official PHP 5.5.x to PHP 5.6.x migration guide and its backward-incompatible changes chapter with the APIs and extensions your application actually uses, then test the application before a production upgrade. The release announcement was published on August 28, 2014; PHP 5.6 is a historical release, so this feature overview should not be read as a recommendation to deploy it as a current PHP version.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




