Skip to content

feat: Allow to configure the parser PHP version#1044

Merged
theofidry merged 5 commits intohumbug:mainfrom
theofidry:feat/php-version
Jun 16, 2024
Merged

feat: Allow to configure the parser PHP version#1044
theofidry merged 5 commits intohumbug:mainfrom
theofidry:feat/php-version

Conversation

@theofidry
Copy link
Member

@theofidry theofidry commented Jun 15, 2024

This PR introduces a php-version to the configuration file and as command options for the add-prefix and inspect command (e.g. have --php-version=7.2).

The PHP version provided is used to configure the underlying PHP-Parser Parser and Printer. This will not affect
the PHP internal symbols used by PHP-Scoper (i.e. mb_str_pad will be understood as an internal function, even if the PHP version configured is <8.3). However, this will affect what code can be parsed and how the code will be printed.

If no PHP version is used, the host version will be used, i.e. executing it with PHP 8.4 will
result in PHP 8.4 being used as the PHP version.

This should allow to forcefully fix sebastianbergmann/phpunit#5855.

@theofidry theofidry marked this pull request as ready for review June 16, 2024 14:52
@theofidry theofidry merged commit 226ba7d into humbug:main Jun 16, 2024
@theofidry theofidry deleted the feat/php-version branch June 16, 2024 15:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PHP-Scoper 0.18.12 breaks PHAR for PHPUnit 8.5 on PHP 7.2

1 participant