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

Typed class constants are shown as invalid in PHP 8.3 #82

Open
Kaylen7 opened this issue Oct 9, 2024 · 0 comments
Open

Typed class constants are shown as invalid in PHP 8.3 #82

Kaylen7 opened this issue Oct 9, 2024 · 0 comments

Comments

@Kaylen7
Copy link

Kaylen7 commented Oct 9, 2024

The following code is valid for php versions higher than 8.3 (Php.watch link).

`<?php

class Test {
const string FOO = 'test';
public function print(){
echo self::FOO;
}
}

$test = new Test();
$test->print();`

VSCode IntelliSense extension underlines string (l.4) and the error message says that '=' is expected as it takes type as the name of the constant.

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

1 participant