demo
demo copied to clipboard
Running "./bin/phpunit" fails on PHP 7.4
When running $ ./bin/phpunit
as per the README, I am getting the following error with PHP 7.4:
derick@gargleblaster:/tmp/tracer_demo$ ./bin/phpunit
#!/usr/bin/env php
Installing phpunit/phpunit (7.5.16)
Plugins have been disabled.
- Installing phpunit/phpunit (7.5.16): Loading from cache
Created project in phpunit-7.5
composer.json has been updated
Loading composer repositories with package information
[ErrorException]
Trying to access array offset on value of type null
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
this seems to be a bug in composer itself, as the error happens during the composer install
(of the phpunit codebase).
It may be a problem in one of the scripts Symfony registers in Composer.
Try to add -v
(verbose) option to get more details, i.e., stack trace.
-v
doesn't do anything different, as this goes through the bin/phpunit
thing, which doesn't accept -v
.
you might temporarily edit vendor/symfony/phpunit-bridge/bin/simple-phpunit.php
to add a -v
in the command running composer.
I have tried it now and had no problems. This is my setup:
# OS: macOS 10.15.2
$ composer --version
Composer version 1.9.1 2019-11-01 17:20:17
$ ./bin/console about
-------------------- -----------------------------------------------------
Symfony
-------------------- -----------------------------------------------------
Version 5.0.1
Long-Term Support No
End of maintenance 07/2020
End of life 07/2020
-------------------- -----------------------------------------------------
Kernel
-------------------- -----------------------------------------------------
Type App\Kernel
Environment dev
Debug true
Charset UTF-8
Cache directory ./var/cache/dev (7.5 MiB)
Log directory ./var/log (190 KiB)
-------------------- -----------------------------------------------------
PHP
-------------------- -----------------------------------------------------
Version 7.4.1
Architecture 64 bits
Intl locale en_US
Timezone UTC (2019-12-29T15:44:13+00:00)
OPcache true
APCu true
Xdebug true
-------------------- -----------------------------------------------------
Environment (.env)
-------------------- -----------------------------------------------------
APP_ENV dev
APP_SECRET 67d829bf61dc5f87a73fd814e2c9f629
DATABASE_URL sqlite:///%kernel.project_dir%/data/database.sqlite
MAILER_URL null://localhost
-------------------- -----------------------------------------------------
Also have this problem.
Composer version 1.9.2 Symfony 4.4.2 PHP 7.4.1
But it is working on: Composer version 1.9.1 Symfony 4.4.2 PHP 7.3
composer self-update
solved the problem for me since I was using pretty old version.
Let's close this old issue because the newest Symfony Demo versions already require PHP 8.1. Thanks.