Skip to content
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

Syntax error with dynamic enum access in PHP 8.3 #2872

Open
ben-mckenzie opened this issue May 1, 2024 · 0 comments
Open

Syntax error with dynamic enum access in PHP 8.3 #2872

ben-mckenzie opened this issue May 1, 2024 · 0 comments

Comments

@ben-mckenzie
Copy link

Describe the bug
Intelephense appears to not support dynamically accessing enum variants via the syntax MyEnum::{$myVar} even when PHP version is set to 8.3.

To Reproduce
Set "intelephense.environment.phpVersion": "8.3.0" or similar
Disable PHP Language Features

Test snippet:

<?php

enum Test: string {
    case A = 'a';
    case B = 'b';
}

$a = 'A';

echo Test::{$a};

Squiggle appears under final semicolon, with Unexpected ';'. Expected '('.intelephense(P1001)

Expected behavior
Treats as valid syntax for PHP 8.3 with no squiggles

Platform and version
Windows 10 22H2, WSL2, VS Code v1.88.1, Intelephense v1.10.4.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants