-
Notifications
You must be signed in to change notification settings - Fork 62
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
Add support for PHP 8 #106
Conversation
Would like to test, but unfortunately @willdurand will back only 7th September |
How to move it forward? |
Ping @willdurand |
Hey, sorry about that. I can review this patch, although I haven' done any PHP in years. Can someone else also review this PR please? |
Woah, ok. That's good to know, this will require a new major release then. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative option to keep support for PHP < 7.3 is to install different PHPUnit versions in Travis for each build. If you want to go that route then I'll update the PR accordingly.
Would you have a link to the version calendar? Are PHP 7.1 and 7.2 still supported? What about usage?
- hhvm | ||
|
||
matrix: | ||
allow_failures: | ||
- php: hhvm | ||
|
||
before_script: | ||
- composer self-update | ||
- composer install --prefer-dist --no-interaction | ||
- composer self-update --2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does --2
mean?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Force update composer
to 2.0.0-RC1
.
@@ -83,7 +83,7 @@ public function getOrderedElements($header) | |||
$qB = $b[0]; | |||
|
|||
if ($qA == $qB) { | |||
return $a[1] > $b[1]; | |||
return $a[1] <=> $b[1]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is a very useful change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This just changes the return value from a boolean (which then gets converted to an int) to the proper expected return value (E.G -1
, 0
or 1
)
PHP 7.1 is not supported anymore, and PHP 7.2 is in security-fix only, which will end in November of this year (https://www.php.net/supported-versions.php). Based on https://blog.packagist.com/php-versions-stats-2020-1-edition/ (as of May this year), PHP 7.2 usage is still quite high (almost 30%), but seeing as it will be unsupported in a couple months, it might be good to drop support for it now. |
Maybe @dunglas? I know ApiPlatform uses this package |
I've added Symfony PHPUnit bridge and re-added PHP 7.1 and 7.2 to Travis, so I think this is now ready. |
Is this fix available in any release? (or only |
dev-master only |
The biggest change to support PHP 8 is the
Match
class which fails due to the new match expression (match
is now a reserved keyword).This PR also adds PHP nightly on Travis in order to run the unit tests on PHP 8. This requires an upgrade on PHPUnit to 9.3-dev which is the only version to support PHP 8. But this means PHP 7.0 - 7.2 support needs to be dropped (7.2 is in security-fix for the next 3 months only).
An alternative option to keep support for PHP < 7.3 is to install different PHPUnit versions in Travis for each build. If you want to go that route then I'll update the PR accordingly.