Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prefixed infection.phar does not work on PHP 7.4 #1573

Closed
maks-rafalko opened this issue Sep 12, 2021 · 6 comments · Fixed by #1641
Closed

Prefixed infection.phar does not work on PHP 7.4 #1573

maks-rafalko opened this issue Sep 12, 2021 · 6 comments · Fixed by #1641
Labels

Comments

@maks-rafalko
Copy link
Member

  • Compile infection.phar with make compile-docker
  • run on PHP 7.4

Error:

Fatal error: Uncaught Error: Class 'Symfony\Polyfill\Php80\Php80' not found in phar:///app/infection-builds/infection.phar/vendor/symfony/polyfill-php80/bootstrap.php:29
Stack trace:
#0 phar:///app/infection-builds/infection.phar/vendor/symfony/console/Formatter/OutputFormatter.php(103): str_contains('', '\x00')
#1 phar:///app/infection-builds/infection.phar/vendor/symfony/console/Formatter/OutputFormatter.php(70): _HumbugBox1eb33c9b814d\Symfony\Component\Console\Formatter\OutputFormatter->formatAndWrap('', 0)
#2 phar:///app/infection-builds/infection.phar/vendor/symfony/console/Output/Output.php(76): _HumbugBox1eb33c9b814d\Symfony\Component\Console\Formatter\OutputFormatter->format('')
#3 phar:///app/infection-builds/infection.phar/vendor/symfony/console/Output/Output.php(59): _HumbugBox1eb33c9b814d\Symfony\Component\Console\Output\Output->write(Array, true, 16)
#4 phar:///app/infection-builds/infection.phar/vendor/symfony/console/Application.php(500): _HumbugBox1eb33c9b814d\Symfony\Component\Console\Output\Output->write in phar:///app/infection-builds/infection.phar/vendor/symfony/polyfill-php80/bootstrap.php on line 29

Note: it works fine for PHP 8+.

You can download PHAR from 0.25.1 to check it as well.

Related to #1568 #1508

@theofidry probably you will have some time to give an advice, as I'm not sure I understand what is going on there.

@theofidry
Copy link
Member

I cna check atm but i would check if the polyfills are whitelisted the proper way. I think humbug/php-scoper#481 is the way to go for them

@eclipxe13
Copy link

Looks like this won't be fixed, as a work around install via composer as development dependency. You can do this on the same project or in a different folder, by example:

mkdir -p tools/infection
composer require -d tools/infection --dev infection/infection
tools/infection/vendor/bin/infection ...

@voku
Copy link

voku commented Feb 3, 2022

I was confused about the error message because the documentation still says it's support PHP 7.4: https://infection.github.io/guide/installation.html but the phar file only works with PHP 8, or?

PHP version Infection version
7.4.0 >= 0.18

@maks-rafalko
Copy link
Member Author

well, it should work on 7.4 for 0.26.x version. Isn't it the case?

Next Infection version (0.27.x) will work only on PHP 8+.

@voku
Copy link

voku commented Feb 3, 2022

No it's not working with PHP 7.4, still the same error from Symfony\Polyfill\Php80\Php80

@theofidry
Copy link
Member

For what it's worth as soon as a PR is merged on AMP functions (which should be soon), I can do a release of Box which should fix (partially) support for up to 8.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants