How to upgrade php version keeping backward compatibility ? #7520
-
I am currently using PHP 7.0 and would like to update to PHP 7.1. $rectorConfig->phpVersion(PhpVersion::PHP_70);
$rectorConfig->import(LevelSetList::UP_TO_PHP_71); When I run rector, it makes changes which are not backward compatible with php 7.0, for example it adds public visibility prefixes to the constants. Is there any way to tell Rector to update the code to php 7.1 but keep it compatible with php 7.0? |
Beta Was this translation helpful? Give feedback.
Answered by
TomasVotruba
Oct 2, 2022
Replies: 1 comment 7 replies
-
Hi, the 2nd line changes PHP version to PHP 7.1: $rectorConfig->phpVersion(PhpVersion::PHP_70);
$rectorConfig->import(LevelSetList::UP_TO_PHP_71); Change the order: $rectorConfig->import(LevelSetList::UP_TO_PHP_71);
$rectorConfig->phpVersion(PhpVersion::PHP_70); |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
beeyev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
the 2nd line changes PHP version to PHP 7.1:
Change the order: