(Go: >> BACK << -|- >> HOME <<)

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

Feature request: Typed class constants in PHP 8.3 #2653

Open
madflow opened this issue May 14, 2024 · 2 comments
Open

Feature request: Typed class constants in PHP 8.3 #2653

madflow opened this issue May 14, 2024 · 2 comments

Comments

@madflow
Copy link
madflow commented May 14, 2024
<?php

class Sth
{
    public const array TEST = [];

}

$a = Sth::TEST;
Constant "TEST" does not exist on class "Sth" phpactor [9, 11]
@mamazu
Copy link
Contributor
mamazu commented Jun 16, 2024

The code in phpactor works as intended. The problem is the parser doesn't correctly recognize the name as it assumes the first token after const is the name. So Sth::array should be the property it finds.

But a fix is on the way. @dantleech Looks like you already tried that. Is there anything stopping this project?

@przepompownia
Copy link
Contributor

#2496

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

No branches or pull requests

3 participants