Steps to reproduce
Look at https://integration.wikimedia.org/ci/job/mwext-phpunit-coverage-patch-docker/74896/console (PHP coverage test for https://gerrit.wikimedia.org/r/c/mediawiki/extensions/DoubleWiki/+/781012).
Actual result
The following error message appeared:
$ exec phpunit-patch-coverage check --command 'php -d extension=pcov.so -d pcov.enabled=1 -d pcov.directory=/workspace/src/extensions/DoubleWiki -d pcov.exclude='\''@(tests|vendor)@'\'' -d pcov.initial.files=3000 "$MW_INSTALL_PATH"/tests/phpunit/phpunit.php' --html /workspace/log/coverage.html Finding coverage difference in 62c8dd6b3d2de55ac62857328e9988c473ced82f In ParserAbstract.php line 293: Syntax error, unexpected T_STRING, expecting T_FUNCTION or T_CONST on line 37
and jenkins-bot reported that the PHP test coverage decreased.
Expected result
No syntax error, no report about decreased test coverage (zero coverage cannot be decreased…).
Other information
I don’t know what this ParserAbstract.php is or in what environment it’s run, but my first instinct is that a file updated for PHP 7.4 (by adding attribute type declarations, which are T_STRINGs) is run under PHP 7.3 or lower:
class ParserAbstract { private int $foo; // ^ T_PRIVATE ^ T_STRING ^ T_VARIABLE