sebastianbergmann / phpunit

The PHP Unit Testing framework.
https://phpunit.de/
BSD 3-Clause "New" or "Revised" License
19.67k stars 2.2k forks source link

Support PHP 8 #4325

Closed sebastianbergmann closed 4 years ago

sebastianbergmann commented 4 years ago

PHPUnit 9 is being tested against nightly builds of PHP 8 for quite a while and it is safe to say that -- as of right now -- PHPUnit 9 works on PHP 8. While some things might still change until PHP 8.0.0 is released, it is time to make the support for PHP 8 official.

However, this is not as simple as applying

diff --git a/composer.json b/composer.json
index 0f8416d1d..2bf0fa21e 100644
--- a/composer.json
+++ b/composer.json
@@ -22,7 +22,7 @@
     "prefer-stable": true,
     "minimum-stability": "dev",
     "require": {
-        "php": "^7.3",
+        "php": "^7.3 || ^8.0",

to this repository for phpunit/phpunit.

PHP 8.0 also needs to be allowed in the composer.json files of PHPUnit's dependencies:

$ composer info | sort -d
doctrine/instantiator              1.3.1             A small, lightweight utility to instantiate objects in PHP without invoking their constructors
myclabs/deep-copy                  1.9.5             Create deep copies (clones) of your objects
phar-io/manifest                   1.0.3             Component for reading phar.io manifest information from a PHP Archive (PHAR)
phar-io/version                    2.0.1             Library for handling version information and constraints
phpdocumentor/reflection-common    2.1.0             Common reflection classes used by phpdocumentor to reflect the code structure
phpdocumentor/reflection-docblock  5.1.0             With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.
phpdocumentor/type-resolver        1.2.0             A PSR-5 based resolver of Class names, Types and Structural Element Names
phpspec/prophecy-phpunit           v2.0.0            PhpUnit test case integrating the Prophecy mocking library
phpspec/prophecy                   v1.10.3           Highly opinionated mocking framework for PHP 5.3+
phpunit/php-code-coverage          9.0.x-dev 4b3293f Library that provides collection, processing, and rendering functionality for PHP code coverage information.
phpunit/php-file-iterator          3.0.2             FilterIterator implementation that filters files based on a list of suffixes.
phpunit/php-invoker                3.0.1             Invoke callables with a timeout
phpunit/php-text-template          2.0.1             Simple template engine.
phpunit/php-timer                  5.0.0             Utility class for timing
phpunit/php-token-stream           4.0.2             Wrapper around PHP's tokenizer extension.
sebastian/code-unit                1.0.3             Collection of value objects that represent the PHP code units
sebastian/code-unit-reverse-lookup 2.0.1             Looks up which function or method a line of code belongs to
sebastian/comparator               4.0.2             Provides the functionality to compare PHP values for equality
sebastian/diff                     4.0.1             Diff implementation
sebastian/environment              5.1.1             Provides functionality to handle HHVM/PHP environments
sebastian/exporter                 4.0.1             Provides the functionality to export PHP variables for visualization
sebastian/global-state             5.0.x-dev 836ce3a Snapshotting of global state
sebastian/object-enumerator        4.0.1             Traverses array structures and object graphs to enumerate all referenced objects
sebastian/object-reflector         2.0.1             Allows reflection of object attributes, including inherited and non-public ones
sebastian/recursion-context        4.0.1             Provides functionality to recursively process PHP variables
sebastian/resource-operations      3.0.1             Provides a list of PHP built-in functions that operate on resources
sebastian/type                     2.1.0             Collection of value objects that represent the types of the PHP type system
sebastian/version                  3.0.0             Library that helps with managing the version number of Git-hosted PHP projects
symfony/polyfill-ctype             v1.17.1           Symfony polyfill for ctype functions
theseer/tokenizer                  1.1.3             A small library for converting tokenized PHP source code into XML and potentially other formats
webmozart/assert                   1.9.0             Assertions to validate method input/output with nice error messages.

Of course, I will take care of all dependencies that live in the sebastian/ and phpunit/ namespaces myself.

sebastianbergmann commented 4 years ago

In the meantime, here is how you can install PHPUnit 9 with Composer 2 for PHP 8:

$ php-80 --version                                                                                                                                  
PHP 8.0.0-dev (cli) (built: Jun 26 2020 09:26:43) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.0-dev, Copyright (c) Zend Technologies
    with Zend OPcache v8.0.0-dev, Copyright (c), by Zend Technologies
$ php-80 /usr/local/bin/composer --version
Composer version 2.0-dev (2.0-dev+4a2ea3c67aa49a3dce68ef5a56614e1941d68965) 2020-06-25 07:16:23
$ php-80 /usr/local/bin/composer require --dev phpunit/phpunit
Using version ^5.2 for phpunit/phpunit
./composer.json has been created
Running composer update phpunit/phpunit
Loading composer repositories with package information
Updating dependencies
Lock file operations: 22 installs, 0 updates, 0 removals
  - Locking doctrine/instantiator (1.3.1)
  - Locking myclabs/deep-copy (1.6.1)
  - Locking phpdocumentor/reflection-docblock (2.0.5)
  - Locking phpspec/prophecy (v1.5.0)
  - Locking phpunit/php-code-coverage (3.2.0)
  - Locking phpunit/php-file-iterator (1.4.5)
  - Locking phpunit/php-text-template (1.2.1)
  - Locking phpunit/php-timer (1.0.8)
  - Locking phpunit/php-token-stream (1.4.12)
  - Locking phpunit/phpunit (5.2.7)
  - Locking phpunit/phpunit-mock-objects (3.1.3)
  - Locking sebastian/code-unit-reverse-lookup (1.0.0)
  - Locking sebastian/comparator (1.2.4)
  - Locking sebastian/diff (1.4.1)
  - Locking sebastian/environment (1.3.7)
  - Locking sebastian/exporter (1.2.2)
  - Locking sebastian/global-state (1.1.1)
  - Locking sebastian/recursion-context (1.0.5)
  - Locking sebastian/resource-operations (1.0.0)
  - Locking sebastian/version (2.0.1)
  - Locking symfony/polyfill-ctype (v1.17.1)
  - Locking symfony/yaml (v3.4.42)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 22 installs, 0 updates, 0 removals
  - Downloading phpdocumentor/reflection-docblock (2.0.5)
  - Downloading phpunit/php-token-stream (1.4.12)
  - Downloading symfony/yaml (v3.4.42)
  - Downloading sebastian/environment (1.3.7)
  - Downloading sebastian/diff (1.4.1)
  - Downloading phpunit/phpunit-mock-objects (3.1.3)
  - Downloading phpunit/php-timer (1.0.8)
  - Downloading sebastian/code-unit-reverse-lookup (1.0.0)
  - Downloading phpunit/php-code-coverage (3.2.0)
  - Downloading phpspec/prophecy (v1.5.0)
  - Downloading myclabs/deep-copy (1.6.1)
  - Downloading phpunit/phpunit (5.2.7)
  - Installing phpdocumentor/reflection-docblock (2.0.5): Extracting archive
  - Installing phpunit/php-token-stream (1.4.12): Extracting archive
  - Installing symfony/polyfill-ctype (v1.17.1): Extracting archive
  - Installing symfony/yaml (v3.4.42): Extracting archive
  - Installing sebastian/version (2.0.1): Extracting archive
  - Installing sebastian/resource-operations (1.0.0): Extracting archive
  - Installing sebastian/global-state (1.1.1): Extracting archive
  - Installing sebastian/recursion-context (1.0.5): Extracting archive
  - Installing sebastian/exporter (1.2.2): Extracting archive
  - Installing sebastian/environment (1.3.7): Extracting archive
  - Installing sebastian/diff (1.4.1): Extracting archive
  - Installing sebastian/comparator (1.2.4): Extracting archive
  - Installing phpunit/php-text-template (1.2.1): Extracting archive
  - Installing doctrine/instantiator (1.3.1): Extracting archive
  - Installing phpunit/phpunit-mock-objects (3.1.3): Extracting archive
  - Installing phpunit/php-timer (1.0.8): Extracting archive
  - Installing phpunit/php-file-iterator (1.4.5): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (1.0.0): Extracting archive
  - Installing phpunit/php-code-coverage (3.2.0): Extracting archive
  - Installing phpspec/prophecy (v1.5.0): Extracting archive
  - Installing myclabs/deep-copy (1.6.1): Extracting archive
  - Installing phpunit/phpunit (5.2.7): Extracting archive
6 package suggestions were added by new dependencies, use `composer suggest` to see details.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
3 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

PHPUnit 5.2.7 has

"php": ">=5.6"

in its composer.json.

That is not a version constraint.

$ rm -rf composer.json composer.lock vendor
$ php-80 /usr/local/bin/composer require --dev phpunit/phpunit ^9.2

  [RuntimeException]                                                                                    
  No composer.json present in the current directory, this may be the cause of the following exception.  

  [InvalidArgumentException]                                                                                                             
  Package phpunit/phpunit at version ^9.2 has a PHP requirement incompatible with your PHP version, PHP extensions and Composer version  

require [--dev] [--dry-run] [--prefer-source] [--prefer-dist] [--fixed] [--no-suggest] [--no-progress] [--no-update] [--no-install] [--no-scripts] [--update-no-dev] [--update-with-dependencies] [--update-with-all-dependencies] [--with-dependencies] [--with-all-dependencies] [--ignore-platform-req IGNORE-PLATFORM-REQ] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--sort-packages] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--] [<packages>]...

PHPUnit 9.2.5 has

"php": "^7.3"

in its composer.json.

Until this ticket is closed, you can use the following:

$ php-80 /usr/local/bin/composer require --dev --ignore-platform-req=php phpunit/phpunit ^9.2
./composer.json has been created
Running composer update phpunit/phpunit
Loading composer repositories with package information
Updating dependencies
Lock file operations: 31 installs, 0 updates, 0 removals
  - Locking doctrine/instantiator (1.3.1)
  - Locking myclabs/deep-copy (1.9.5)
  - Locking phar-io/manifest (1.0.3)
  - Locking phar-io/version (2.0.1)
  - Locking phpdocumentor/reflection-common (2.1.0)
  - Locking phpdocumentor/reflection-docblock (4.3.4)
  - Locking phpdocumentor/type-resolver (1.2.0)
  - Locking phpspec/prophecy (v1.10.3)
  - Locking phpunit/php-code-coverage (8.0.2)
  - Locking phpunit/php-file-iterator (3.0.2)
  - Locking phpunit/php-invoker (3.0.1)
  - Locking phpunit/php-text-template (2.0.1)
  - Locking phpunit/php-timer (5.0.0)
  - Locking phpunit/php-token-stream (4.0.2)
  - Locking phpunit/phpunit (9.2.5)
  - Locking sebastian/code-unit (1.0.3)
  - Locking sebastian/code-unit-reverse-lookup (2.0.1)
  - Locking sebastian/comparator (4.0.2)
  - Locking sebastian/diff (4.0.1)
  - Locking sebastian/environment (5.1.1)
  - Locking sebastian/exporter (4.0.1)
  - Locking sebastian/global-state (4.0.0)
  - Locking sebastian/object-enumerator (4.0.1)
  - Locking sebastian/object-reflector (2.0.1)
  - Locking sebastian/recursion-context (4.0.1)
  - Locking sebastian/resource-operations (3.0.1)
  - Locking sebastian/type (2.1.0)
  - Locking sebastian/version (3.0.0)
  - Locking symfony/polyfill-ctype (v1.17.1)
  - Locking theseer/tokenizer (1.1.3)
  - Locking webmozart/assert (1.9.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 31 installs, 0 updates, 0 removals
  - Downloading phpunit/phpunit (9.2.5)
  - Installing symfony/polyfill-ctype (v1.17.1): Extracting archive
  - Installing webmozart/assert (1.9.0): Extracting archive
  - Installing phpdocumentor/reflection-common (2.1.0): Extracting archive
  - Installing phpdocumentor/type-resolver (1.2.0): Extracting archive
  - Installing phpdocumentor/reflection-docblock (4.3.4): Extracting archive
  - Installing phpunit/php-token-stream (4.0.2): Extracting archive
  - Installing sebastian/version (3.0.0): Extracting archive
  - Installing sebastian/type (2.1.0): Extracting archive
  - Installing sebastian/resource-operations (3.0.1): Extracting archive
  - Installing sebastian/recursion-context (4.0.1): Extracting archive
  - Installing sebastian/object-reflector (2.0.1): Extracting archive
  - Installing sebastian/object-enumerator (4.0.1): Extracting archive
  - Installing sebastian/global-state (4.0.0): Extracting archive
  - Installing sebastian/exporter (4.0.1): Extracting archive
  - Installing sebastian/environment (5.1.1): Extracting archive
  - Installing sebastian/diff (4.0.1): Extracting archive
  - Installing sebastian/comparator (4.0.2): Extracting archive
  - Installing sebastian/code-unit (1.0.3): Extracting archive
  - Installing phpunit/php-timer (5.0.0): Extracting archive
  - Installing phpunit/php-text-template (2.0.1): Extracting archive
  - Installing phpunit/php-invoker (3.0.1): Extracting archive
  - Installing phpunit/php-file-iterator (3.0.2): Extracting archive
  - Installing theseer/tokenizer (1.1.3): Extracting archive
  - Installing sebastian/code-unit-reverse-lookup (2.0.1): Extracting archive
  - Installing phpunit/php-code-coverage (8.0.2): Extracting archive
  - Installing doctrine/instantiator (1.3.1): Extracting archive
  - Installing phpspec/prophecy (v1.10.3): Extracting archive
  - Installing phar-io/version (2.0.1): Extracting archive
  - Installing phar-io/manifest (1.0.3): Extracting archive
  - Installing myclabs/deep-copy (1.9.5): Extracting archive
  - Installing phpunit/phpunit (9.2.5): Extracting archive
4 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
20 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
$ php-80 ./vendor/bin/phpunit --version                                                      
PHPUnit 9.2.5 by Sebastian Bergmann and contributors.
mvriel commented 4 years ago

@sebastianbergmann thanks for mentioning us; @jaapio and I will look into this!

jaapio commented 4 years ago

phpdocumentor/reflection-common is upgraded, 2.2.0 supports php 8.

sebastianbergmann commented 4 years ago

phpdocumentor/reflection-common is upgraded, 2.2.0 supports php 8.

Thank you, @jaapio.

jaapio commented 4 years ago

phpdocumentor/type-resolver is now also upgraded, from version 1.3.0

sebastianbergmann commented 4 years ago

phpdocumentor/type-resolver is now also upgraded, from version 1.3.0

Thank you, @jaapio.

theseer commented 4 years ago

The phar.io components (phar-io/manifest and phar-io/version) are updated to 2.0.1 and 3.0.2, respectively.

theseer/tokenizer is pending because of https://github.com/theseer/tokenizer/issues/11

sebastianbergmann commented 4 years ago

The phar.io components (phar-io/manifest and phar-io/version) are updated to 2.0.1 and 3.0.2, respectively.

Thank you, @theseer.

sebastianbergmann commented 4 years ago

Thank you, @Ayesh for https://github.com/phar-io/version/pull/21, https://github.com/phar-io/manifest/pull/11, https://github.com/theseer/tokenizer/pull/10, https://github.com/webmozart/assert/pull/207, and https://github.com/myclabs/DeepCopy/pull/157.

Ayesh commented 4 years ago

Thank you @sebastianbergmann. myclabs/deep-copy is tagged 1.10.0 with PHP 8 support.

sebastianbergmann commented 4 years ago

myclabs/deep-copy is tagged 1.10.0 with PHP 8 support.

Thank you, @Ayesh and @theofidry.

sebastianbergmann commented 4 years ago

CC @davedevelopment @robertbasic @padraic for mockery/mockery because of https://github.com/phpDocumentor/ReflectionDocBlock/runs/814383275?check_suite_focus=true

sebastianbergmann commented 4 years ago

CC @cordoval @davedevelopment @aik099 for hamcrest/hamcrest-php because of https://github.com/phpDocumentor/ReflectionDocBlock/runs/814383275?check_suite_focus=true

mvorisek commented 4 years ago

Currently, phpunit will install on PHP 8.0 with the following composer.json config, so these needs to be solved urgently:

"replace": {
    "phar-io/manifest": "1.0.99",
    "phar-io/version": "2.0.99",
    "phpspec/prophecy": "1.10.99",
    "sebastian/diff": "4.0.1",
    "phpunit/php-code-coverage": "9.0"
  }

@sebastianbergmann can you update master to:

thanks

sebastianbergmann commented 4 years ago

phpunit/phpunit, sebastian/global-state, and phpunit/php-code-coverage will be released/tagged with ^8.0 in their composer.json on August 7, 2020 for PHPUnit 9.3.

I somehow forgot about sebastian/diff apparently, thank you for bringing that to my attention. I will also take care of allowing the new versions of phar-io/manifest and phar-io/version.

I will not fork phpspec/prophecy or anything else, however.

sebastianbergmann commented 4 years ago

Currently, phpunit will install on PHP 8.0 with the following composer.json config

PHPUnit 9.2 can be installed with Composer 2

$ composer require --dev --ignore-platform-req=php phpunit/phpunit ^9.2

as explained in https://github.com/sebastianbergmann/phpunit/issues/4325#issuecomment-650064938.

And with Composer 1:

$ composer require --dev --ignore-platform-reqs phpunit/phpunit ^9.2
ciaranmcnulty commented 4 years ago

Prophecy is on the list; it seems to only require a couple of changes but I'm tied up for the next few days

sebastianbergmann commented 4 years ago

Prophecy is on the list; it seems to only require a couple of changes but I'm tied up for the next few days

Thank you, @ciaranmcnulty for taking the time to work on this. It's not urgent (PHP 8 is ~ 6 months away, PHPUnit 9.3 is ~ 1 month away), but, of course, the sooner the better.

stof commented 4 years ago

Regarding phpspec/prophecy-phpunit, it requires no change by itself. But it of course needs support from Prophecy first.

Ayesh commented 4 years ago

I opened phpspec/prophecy#477, but it's rather complicated due to PHP 8's Reflection API changes. (deprecated methods, removal of a method, etc). I'd appreciate any reviews/contributions.

GrahamCampbell commented 4 years ago

@sebastianbergmann, @jaapio https://github.com/hamcrest/hamcrest-php/pull/65 is now ready for review by @davedevelopment, which will allow PHP Documentor to progress.

GrahamCampbell commented 4 years ago

@sebastianbergmann, @jaapio https://github.com/mockery/mockery/pull/1072 is now also ready for review by @davedevelopment, which will allow PHP Documentor to progress. Lots of changes!

sebastianbergmann commented 4 years ago

@GrahamCampbell Thank you for taking care of https://github.com/hamcrest/hamcrest-php/pull/65 and https://github.com/mockery/mockery/pull/1072.

@davedevelopment Thank you for merging these changes for hamcrest/hamcrest-php and mockery/mockery.

GrahamCampbell commented 4 years ago

There's still the small matter of merging mockery 1.3 -> master, so the fixes will be available in the 1.4.x series too. Hopefully I can take care of that today. There will certainly be merge conflicts. ;)

ciaranmcnulty commented 4 years ago

Thanks for organising this tracker issue @sebastianbergmann, it's very handy as most of our dependencies for phpspec are here too :)

phpspec/prophecy has been tagged as 1.11.0 with I think all of the reflection deprecations fixed (thanks to @Ayesh)

However since that release I've noticed that doubling a class or interface that uses union types fails hard, so we will need to fix that in prophecy before advertising 8.0 support

GrahamCampbell commented 4 years ago

@webmozart are you able to tag a release on your repo? Because you don't have a branch alias, there is no way to install dev versions of your package.

sebastianbergmann commented 4 years ago

Thank you, Ciaran, for taking care of phpspec/prophecy. Next stop: phpspec/prophecy-phpunit. :)

webmozart commented 4 years ago

@GrahamCampbell I'm tagging @BackEndTea for this who is currently maintaining the assert package

GrahamCampbell commented 4 years ago

It actually looks like there are still significant problems with PHP 8 on that package: https://travis-ci.org/github/webmozart/assert/jobs/696587522.

Ayesh commented 4 years ago

webmozart/assert pass PHP nightly tests: https://travis-ci.org/github/webmozart/assert/jobs/705105782

GrahamCampbell commented 4 years ago

Oh yeh. Not sure how I ended up at that other build!

BackEndTea commented 4 years ago

webmozart/aseert 1.9.1 is php 8.0 compatible @sebastianbergmann. Thanks to @Ayesh & @GrahamCampbell

GrahamCampbell commented 4 years ago

RE hamcrest, 2.0.1 release PR is in now: https://github.com/hamcrest/hamcrest-php/pull/67.

stof commented 4 years ago

prophecy-phpunit is now released as 2.0.1 advocating PHP 8 support (in the limits of the PHP 8 support in prophecy itself)

GrahamCampbell commented 4 years ago

Hamcrest 2.0.1, Mockery 1.3.2, Mockery 1.4.1 are now released.

sebastianbergmann commented 4 years ago

prophecy-phpunit is now released as 2.0.1 advocating PHP 8 support (in the limits of the PHP 8 support in prophecy itself)

Thank you, Christophe.

Ayesh commented 4 years ago

The last remaining project, theseer/tokenizer has composer.json constraints allowing PHP 8, and tests passing on PHP nightly builds. It just needs a tagged release. Hopefully @theseer tags one, but I suppose the new release probably contains some additional changes in regards to some minor differences in PHP 8's lexer T_WHITESPACE handling.

jaapio commented 4 years ago

phpdocumentor/reflection-docblock build is now passing on PHP 8, we need to fix a couple of unit tests that are using deprecated functionality. After that, we can create a tag.

theseer commented 4 years ago

Yes, theseer/tokenizer is semi-effected by the new T_WHITESPACE handling. Semi-Effected, because the XML-Transformation code almost by accident filters out the side effects of the aforementioned change. As this is what PHPUnit uses, one could argue that I should simply tag a new release with 8.0 among the versions supported.

But I'm not sure whether or not that's the correct way to go: While I do not want keep everybody waiting for no reason, the intermediate format is different and thus technically not correct.

So I'm a bit conflicted about what's best?

GrahamCampbell commented 4 years ago

Match cannot be used as a class name in PHP 8.0 so PHPUnit's mock object code is currently broken.

theseer commented 4 years ago

While I'm not fully happy with the implementation, theseer/tokenizer has been updated and should now work with 7.2+ and 8.0+.

sebastianbergmann commented 4 years ago

theseer/tokenizer has been updated and should now work with 7.2+ and 8.0+.

Thank you, Arne.

ciaranmcnulty commented 4 years ago

I spoke too soon about Prophecy, but it is now passing its nightly build if we force phpunit and phpdocumentor to their @dev versions.

I'll add PHP8 to the composer.json after feature freeze and when phpdocumentor is tagged (if we wait for phpunit that'll presumably cause a deadlock?)

jaapio commented 4 years ago

I just released https://github.com/phpDocumentor/ReflectionDocBlock/releases/tag/5.2.0 should be good to go as far as I was able to check. This should clear the road for others to update.

ciaranmcnulty commented 4 years ago

Thanks @jaapio that fixed the prophecy issues 👍

sebastianbergmann commented 4 years ago

We now use nikic/php-parser which has not been updated for https://github.com/php/php-src/commit/7a3dcc3e339cde2177ba4fe8fc45f78c94dfbb29 yet. This is why the build currently fails on PHP 8.

sebastianbergmann commented 4 years ago

I would like to thank everyone who has contributed to the effort of making PHPUnit itself as well as its dependencies (and their dependencies ...) installable on PHP 8.

TeBoring commented 4 years ago

This is awesome! When will it be available?

GrahamCampbell commented 4 years ago

August 7th, though note that you may still have to ignore platform requirements when installing PHPUnit with composer, even after that release, since not all PHPUnit's dependencies actually allow PHP 8 yet, however all of them at least work well enough so that PHPUnit and it's test suite can run.

sebastianbergmann commented 4 years ago

not all PHPUnit's dependencies actually allow PHP 8 yet

The only dependencies that do not have releases yet that allow PHP 8 are phpunit/php-code-coverage and sebastian/global-state:

$ composer install                                                                
No lock file found. Updating dependencies instead of installing from lock file. Use composer update over composer install if you do not have a lock file.
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Root composer.json requires phpunit/php-code-coverage ^9.0, found phpunit/php-code-coverage[dev-master, 9.0.x-dev (alias of dev-master)] but it does not match your minimum-stability.
  Problem 2
    - Root composer.json requires sebastian/global-state ^5.0, found sebastian/global-state[dev-master, 5.0.x-dev (alias of dev-master)] but it does not match your minimum-stability.

You are using a snapshot build of Composer 2, which may be the cause of the problem. Run `composer self-update --stable` and then try again. In case it solves the problem, please report an issue mentioning Composer 2.

Versions of these packages that allow PHP 8 will be tagged when PHPUnit 9.3 is tagged.