Contents
Chapter 1 summarizes the addition of scalar type hints. This allows your function parameters to explicitly require scalar types like string, int, float, or bool.
Chapter 2 covers the declaration of function return types, including the scalar types mentioned in chapter 1.
In Chapter 3 we explore the brand new “Spaceship Operator” which drastically simplifies 3-way comparison of two expressions.
Chapter 4 introduces another new operator, the “Null Coalesce Operators”. It’s a lot like ?: but with a built-in isset() check.
Chapter 5 demonstrates how to easily add Unicode characters to strings using a new \u{...} escape sequence.
Chapter 6 reviews how anonymous classes can be used to create classes on-the-fly, which is particularly useful for mocking and implementing simple interfaces (like loggers and observers).
Chapter 7 highlights the new ability to include multiple classes from a namespace with a single use statement.
Chapter 8 introduces the new Closure:call method which drastically simplifies binding your closures to objects at call-time.
Chapter 9 shows how generator can now return final values.
Chapter 10 explores how generators can yield from arrays, iterators, and other generators (insert Xzibit “yo dawg” joke here).
In Chapter 11 we see how PHP 7 drastically simplifies the process of generating strong random numbers for security-critical applications.
Chapter 12 demonstrates how to safely and easily perform integer division.
Chapter 13 unveils the new preg_replace_callback_array function for executing different callbacks per regular expression.
Chapter 14 covers the new IntlChar class, which helps you work with Unicode characters.
Chapter 15 shows how PHP 7 is dramatically faster than previous versions.
Chapter 16 describes how syntax is more consistent and flexible.
Chapter 17 explains how previously-reserved keywords can be used for property, constant, and method names. It contains a full list of such words.
Chapter 18 walks through the new changes to engine errors and exceptions.
Chapter 19 highlights the backwards-compatible improvements to the existing assert() feature.
Chapter 20 touches on how define() now supports array constants.
Chapter 21 demonstrates how to safely unserialize untrusted data by whitelisting which classes can be unserialized.
Chapter 22 talks about configuring session options by passing them into session_start().
Chapter 23 outlines the enhancements made to the Reflection API.
Chapter 24 shows how some integer behavior has changed in PHP 7.
Chapter 25 touches on division by zero, and how it works in the latest version of PHP.
Chapter 26 covers the new JSON library used by PHP, including a couple minor changes it introduces.
Chapter 27 demonstrates the inconsistencies in PHP 5’s foreach loops and how its behavior differs from PHP 7.
Chapter 28 describes some adjustments to the behavior of the list() construct.
Chapter 29 explains some of the changes made to function parameter behavior.
Chapter 30 unveils an old bug with custom session handlers and how PHP 7 resolves it.
Chapter 31 briefly touches on octals and how PHP 7 handles invalid ones.
Chapter 32 discusses the deprecation of PHP 4-style constructors.
Chapter 33 covers why manual salt generation is now deprecated in the password hashing API.
Chapter 34 lists all of the previously-deprecated functionality which has been fully removed from PHP 7.
Chapter 35 talks about the removal of alternative PHP tags.
Chapter 36 describes how several E_STRICT notices have been changed to other types.
Chapter 37 shows how multiple default cases are no longer permitted within a switch block.
Chapter 38 demonstrates PHP 5’s inconsistent handling of hexadecimal strings and why that incomplete functionality was removed.
Chapter 39 lists the SAPIs which are no longer supported or maintained.
Chapter 40 briefly highlights the removal of that annoying timezone warning.
And finally, the last section of the book includes a detailed list of all the breaking changes you’ll need to watch out for when migrating to PHP 7.