PHPUnit 7

Major Release

The PHPUnit development team is pleased to announce the release of PHPUnit 7. This release introduces new features and modifies or removes existing functionality.

A detailed list of changes is available here.

PHPUnit now requires PHP 7.1 (or newer)

Active support for PHP 7.0 ended on December 3, 2017. The only actively supported versions of PHP as of February 2, 2018 are PHP 7.1 and PHP 7.2.

PHPUnit now uses (more) PHP 7 syntax

The first lines of code for PHPUnit were written back when PHP 4 was the "latest and greatest". In order to keep PHPUnit compatible with new versions of PHP and to make new features possible, the codebase of PHPUnit needs constant modernization.

It has taken Sebastian Bergmann thousands of hours to develop, test, and support PHPUnit.

Perhaps now is the time to sponsor Sebastian's work.

A lot of time and effort went into the development of PHPUnit 7 to make better use of syntax features such as scalar type declarations and return type declarations, for instance, that were introduced in PHP 7. And quite a few methods that can raise exceptions were missing @throws annotations, there were now added to the documentation of those methods.

Backward Compatibility Issues

While the aforementioned changes make PHPUnit's code easier to read and more robust to work on, they come at the price of backward compatibility breaks.

Looking Forward

The following methods do not have a return value and should therefore have a void return type declaration:

These methods will have a void return type declaration in PHPUnit 8. Please declare your methods that overwrite the above mentioned methods void now so you are not affected by this backward compatibility break.

PHPUnit now has a modern documentation toolchain

The documentation for PHPUnit has been migrated from DocBook to reStructuredText and is now hosted on docs.phpunit.de. Details on the new locations can be found here.

Getting PHPUnit 7

We distribute a PHP Archive (PHAR) that contains everything you need in order to use PHPUnit. Alternatively, you may use Composer to download and install PHPUnit as well as its dependencies.

Here is a tutorial that gets you started.

Supported Versions

Detailed information on supported versions of PHPUnit is available here. Below is a summary as of February 2, 2018: