Uh oh!
There was an error while loading. Please reload this page.
Improve PHP 8.5+ support by avoiding deprecated switch case syntax - #264
Conversation
This must have been a typo, since it's the only instance where the non-standard syntax is used.
WyriHaximus
commented
Nov 15, 2024
Hey, thanks @theodorejb for taking the time to file this PR. There are two things that bother me with this:
|
theodorejb
commented
Nov 15, 2024
@WyriHaximus I ran a script across the top Composer packages to find any that were using the alternate switch case syntax, since I'm considering writing an RFC to deprecate it. In the top 1000 packages, this was one of only two where I found it used. All usages appeared to be typos (randomly mixed in with case statements using the standard syntax). PHP-CS-Fixer will automatically find/fix these issues when using the |
@theodorejb Ahh cool thanks, and tbh been doing PHP for 20+ years and only learned today this is valid syntax 🤦 . And honestly that RFC makes sense. |
clue
left a comment
There was a problem hiding this comment.
@theodorejb TIL! Thanks for looking into this and best of luck with that RFC 👍
(I've marked this as maintenance to emphasize this shouldn't otherwise affect how this code functions.)
Could this fix please be released with due haste ? The PHP 8.5 deprecation has been merged into PHP core and the nightly build for This effectively means that the deprecation notice for the code in the 3.2.0 version is currently causing |
jrfnl
commented
Aug 12, 2025
lolli42
commented
Aug 13, 2025
Yeah. Release would be great due to the "global" composer usage. We added PHP 8.5 to our CI matrix just yesterday, and decided to greenify our pipeline with a composer-patch: TYPO3/Fluid#1189 (just mentioning in case you need something, too). |
Just in case anyone desperately needs it - for most CIs, another work-around is to first A new release would be nicer, but ☝🏻 can unblock people if needs be, without needing to patch the package. |
jrfnl
commented
Aug 13, 2025
@WyriHaximus@clue Just a heads-up: the PHP 8.5 Linux nightly image used by |
This builds on top of reactphp#264 porting that change to v2.
WyriHaximus
commented
Aug 13, 2025
We know <3, but a few things.
Unless I misunderstood how composer builds its bins. It takes the lowest targeted version in range. Which is v2 of this package: https://github.com/composer/composer/blob/main/composer.json#L40 and that version still contains this issue: Line 369 in 1a84609
We should. |
@WyriHaximus Thanks for setting that up! I've just read through the build scripts from Composer and from what I can see, the PHAR file should be using How I got to that tentative conclusion:
This looks to be confirmed when checking the build-script from the last release: https://github.com/composer/composer/actions/runs/16201695550/job/45742084992#step:4:67 The LTS Composer 2.2 branch looks to be on All in all, my supposition is that the This looks to be confirmed by the relevant commit and issue composer/composer#12188 which added the Hope this helps! |
andypost
commented
Aug 15, 2025
Is there any expected date for patch release like 3.2.1? |
jrfnl
commented
Aug 15, 2025
@andypost You can use the work-around described here to continue testing against PHP 8.5 without this patch. |
andypost
commented
Aug 15, 2025
jrfnl
commented
Aug 15, 2025
Just in case anyone needs some example code for the work-around I mentioned before, I'm applying it as a temporary measure to the PHPCS test workflow (as releasing a new major with red crosses on every workflow run makes me uncomfortable 😉) Once a new version of Composer has been released, I'll revert it. |
WyriHaximus
commented
Aug 18, 2025
For reference, the relevant RFC: https://wiki.php.net/rfc/deprecations_php_8_5#languagesyntax_deprecations |
clue
commented
Aug 18, 2025
@jrfnl Thanks for the friendly reminder. Discussed this PR earlier today in the team and will prioritize releasing this once the other maintenance PRs on this milestone are merged. Seeing this currently blocks Composer, definitely expect a release this week, hopefully in the next couple of days. If you're impatient, you can always support the project and may help speed things up by becoming a sponsor ❤️ |
jrfnl
commented
Aug 18, 2025
@clue Appreciate the update! |
jrfnl
commented
Aug 18, 2025
@clue P.S.: didn't mean to ignore your remark about funding, but I'm not the right audience for that. I'm only a lowly, barely paid open source maintainer myself. So let me join you in the call for funding: |
WyriHaximus
commented
Aug 18, 2025
As I just merged #269 and as @clue noted on that PR, the v2 branch will need more changes to get it to work on PHP 8.4. However, as we haven't received any issues about PHP 8.4 compat, and as @jrfnl pointed out in #264 (comment) we're not considering a new v2 tag to address this, unless PHP 8.(4|5) support comes up in an (high profile) issue. Will review #271 tomorrow morning and if it's good merge and release it. |
WyriHaximus
commented
Aug 19, 2025
Bit later than planned today, but |
jrfnl
commented
Aug 19, 2025
Thank you all for getting 3.3.0 released! Now, let's hope Composer updates and releases a new version soon ;-) |
At this moment, nearly every single `composer install` on PHP 8.5 is failing on a deprecation notice coming from the `react/promise` package. To mitigate this, the ReactPHP team has just released a new version and I'd like to suggest for Composer to update to that version and release a new version of Composer itself to unblock early adopters from testing with PHP 8.5. Note: other than fixing the deprecation notice, the `3.3.0` release does not contain any user-facing changes. Ref: * reactphp/promise#264 * https://github.com/reactphp/promise/releases/tag/v3.3.0 * reactphp/promise@v3.2.0...v3.3.0
jrfnl
commented
Aug 19, 2025
FYI: I've opened a PR to Composer to update their dependency: composer/composer#12504 |
At this moment, nearly every single `composer install` on PHP 8.5 is failing on a deprecation notice coming from the `react/promise` package. To mitigate this, the ReactPHP team has just released a new version and I'd like to suggest for Composer to update to that version and release a new version of Composer itself to unblock early adopters from testing with PHP 8.5. Note: other than fixing the deprecation notice, the `3.3.0` release does not contain any user-facing changes. Ref: * reactphp/promise#264 * https://github.com/reactphp/promise/releases/tag/v3.3.0 * reactphp/promise@v3.2.0...v3.3.0 Co-authored-by: jrfnl <jrfnl@users.noreply.github.com>

This must have been a typo, since it's the only instance where the non-standard syntax is used.