7.0.33

Latest release in branch 7.0
Released 7 years ago (January 10, 2019)

Software PHP
Branch 7.0
Status
End of life
End of bug fixes January 10, 2018
End of security fixes January 10, 2019
First official release version 7.0.0
First official release date 10 years ago (December 03, 2015)
Release notes https://www.php.net/ChangeLog-7.php#7.0.33
Source code https://github.com/php/php-src/tree/php-7.0.33
Documentation https://www.php.net/manual/en/
Download https://www.php.net/releases/7.0.33
PHP 7.0 Releases View full list

What Is New in PHP 7.0

Category Key Changes
Performance PHPNG engine (Zend Engine 3), up to 2x performance improvement
New Features Scalar type declarations, Return type declarations, Spaceship operator, Null coalescing operator
Syntax Anonymous classes, Unicode codepoint escape syntax, Group use declarations
Security Filtered unserialize(), CSPRNG functions, Removal of insecure library dependencies
Deprecated PHP4-style constructors, Multiple default clauses in switch statements
Removed mysql extension, ASP-style tags, ereg extension

What performance improvements does PHP 7.0 offer?

The biggest change is the new PHPNG engine (Zend Engine 3), which delivers significantly reduced memory consumption and up to twice the performance of PHP 5.6. This was achieved through a comprehensive refactoring of internal data structures. In practice, this means your applications run faster and can handle more traffic on the same hardware.

What new language features were introduced?

Scalar and Return Type Declarations

You can now enforce parameter and return value types. This makes code more predictable and self-documenting.

function sum(int $a, int $b): int {
    return $a + $b;
}

Null Coalescing Operator

The ?? operator provides a shortcut for common isset() checks. It returns the first operand if it exists and is not NULL, otherwise the second operand.

$username = $_GET['user'] ?? 'nobody';

Spaceship Operator

The <=> operator is used for combined comparison. It returns -1, 0, or 1 when $a is respectively less than, equal to, or greater than $b.

echo 5 <=> 8; // -1

Anonymous Classes

You can now instantiate objects from unnamed classes, similar to anonymous functions. This is useful for one-off implementations.

$util->setLogger(new class {
    public function log($msg) {
        echo $msg;
    }
});

What security enhancements were made?

The unserialize() function was hardened with an optional whitelist of allowed classes, reducing the risk of object injection attacks. New Cryptographically Secure Pseudo-Random Number Generator (CSPRNG) functions were added: random_bytes() and random_int(). These are the preferred methods for generating secure random values.

What was removed or deprecated?

The old mysql_* functions were completely removed--you must use mysqli or PDO instead. ASP-style tags (<% %>) and script tags (<script language="php">) were also removed. PHP4-style constructors (methods with the same name as the class) are now deprecated and will generate an E_DEPRECATED error.

FAQ

Is PHP 7.0 really twice as fast?
Yes, for many real-world applications, especially those using popular frameworks, the performance improvement is very noticeable. The reduced memory footprint is often just as beneficial.

Why should I use the new null coalescing operator?
It dramatically cleans up verbose isset() checks. Instead of writing $a = isset($b) ? $b : $c;, you can simply write $a = $b ?? $c;.

My code uses the old mysql extension. What do I do?
You must migrate to either MySQLi or PDO_MySQL before upgrading. This is a breaking change and the most common upgrade hurdle from PHP 5.x.

What are the new CSPRNG functions for?
Use random_int() for generating cryptographically secure integers and random_bytes() for generating secure random strings. They replace older functions like rand() and openssl_random_pseudo_bytes() for security-critical tasks.

Are typed returns enforced strictly?
It depends on the declared strict mode. By default, PHP will attempt to coerce types. You can enable strict mode by declaring declare(strict_types=1); at the top of your file, which will cause type mismatches to throw a TypeError.

Releases In Branch 7.0

Version Release date
7.0.33 7 years ago
(January 10, 2019)
7.0.32 7 years ago
(September 13, 2018)
7.0.31 7 years ago
(July 19, 2018)
7.0.30 7 years ago
(April 26, 2018)
7.0.29 8 years ago
(March 29, 2018)
7.0.28 8 years ago
(March 01, 2018)
7.0.27 8 years ago
(January 04, 2018)
7.0.26 8 years ago
(November 23, 2017)
7.0.25 8 years ago
(October 26, 2017)
7.0.24 8 years ago
(September 28, 2017)
7.0.23 8 years ago
(August 31, 2017)
7.0.22 8 years ago
(August 03, 2017)
7.0.21 8 years ago
(July 06, 2017)
7.0.20 8 years ago
(June 08, 2017)
7.0.19 8 years ago
(May 11, 2017)
7.0.18 9 years ago
(April 13, 2017)
7.0.17 9 years ago
(March 30, 2017)
7.0.16 9 years ago
(February 16, 2017)
7.0.15 9 years ago
(January 19, 2017)
7.0.14 9 years ago
(December 08, 2016)
7.0.13 9 years ago
(November 10, 2016)
7.0.12 9 years ago
(October 13, 2016)
7.0.11 9 years ago
(September 15, 2016)
7.0.10 9 years ago
(August 18, 2016)
7.0.9 9 years ago
(July 21, 2016)
7.0.8 9 years ago
(June 23, 2016)
7.0.7 9 years ago
(May 26, 2016)
7.0.6 9 years ago
(April 28, 2016)
7.0.5 10 years ago
(March 31, 2016)
7.0.4 10 years ago
(March 03, 2016)
7.0.3 10 years ago
(February 04, 2016)
7.0.2 10 years ago
(January 07, 2016)
7.0.1 10 years ago
(December 17, 2015)
7.0.0 10 years ago
(December 03, 2015)