Skip to content

Fix inconsistent switch case syntax#5

Open
theodorejb wants to merge 1 commit into
TysonAndre:mainfrom
theodorejb:patch-1
Open

Fix inconsistent switch case syntax#5
theodorejb wants to merge 1 commit into
TysonAndre:mainfrom
theodorejb:patch-1

Conversation

@theodorejb

@theodorejb theodorejb commented Nov 8, 2024

Copy link
Copy Markdown

This must have been a typo, since it's the only case statement using the non-standard syntax.

@theodorejb

Copy link
Copy Markdown
Author

@TysonAndre Can you review this when you get a chance?

@DanielEScherzer DanielEScherzer left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just came across this, +1 - needed for Phan to run on 8.5

rlerdorf added a commit to phan/phan that referenced this pull request Sep 30, 2025
The var_representation_polyfill package has a deprecated switch case syntax
(case 'NULL';) that triggers deprecation warnings in PHP 8.5. The package
appears abandoned (last commit 2022), but there is an open PR (#5) that
fixes this issue.

This commit adds a composer patch to fix the deprecated semicolon syntax:
- Added cweagans/composer-patches as dev dependency
- Created patch file to change `case 'NULL';` to `case 'NULL':`
- Configured composer.json to apply the patch automatically

The patch is based on PR #5 from the upstream repository:
TysonAndre/var_representation_polyfill#5

Tested on PHP 8.5.0-dev - no deprecation warnings.
@codemasher

Copy link
Copy Markdown

Hey, phan 6.0.0-beta still crashes because of this

[...]\vendor\tysonandre\var_representation_polyfill\src\VarRepresentation\Encoder.php:157 [8192] Case statements followed by a semicolon (;) are deprecated, use a colon (:) instead
(Phan 6.0.0-beta crashed when parsing/analyzing [...]

@patrickallaert

Copy link
Copy Markdown

👍 🙏

@westerp

westerp commented Jan 13, 2026

Copy link
Copy Markdown

I wan't to test in PHP 8.5. Is there any way we can get a patch released?

@maksimovic

Copy link
Copy Markdown

Can this get some traction any time soon? Had to drop phan from the CI matrix because it's blowing up the suite on 8.5.

@codemasher

Copy link
Copy Markdown

@maksimovic As a workaround in GH Actions you can install the var_representation extension to circumvent the issue.

@Daimona

Daimona commented Jan 28, 2026

Copy link
Copy Markdown

FYI: I created a fork at https://github.com/phan/var_representation_polyfill and am going to make this fix there, then replace the dependency in phan, to fix the issue for phan users (tracked in phan/phan#5420).

Daimona added a commit to phan/var_representation_polyfill that referenced this pull request Jan 28, 2026
Same as
TysonAndre#5.

This was most certainly a typo, and the fix is now needed for PHP 8.5
support.
@bpacholek bpacholek mentioned this pull request Feb 27, 2026
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.

7 participants