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

Class Constants Types PHP 8.3 support #2299

Open
Digitalone1 opened this issue Dec 24, 2023 · 7 comments
Open

Class Constants Types PHP 8.3 support #2299

Digitalone1 opened this issue Dec 24, 2023 · 7 comments

Comments

@Digitalone1
Copy link

Is there a plan to support new 8.3 version? The following code is correct, but prettier says not.

class Foo
{
    public const string PHP_VERSION = "8.3";
}

SyntaxError: Parse Error : syntax error, unexpected 'PHP_VERSION' (T_STRING), expecting '='

@bastoune
Copy link

Hi, is there any plan to release something soon about this ?

@cseufert
Copy link
Collaborator

cseufert commented Apr 4, 2024

Some fo the 8.3 syntax changes are not yet supported by php-prettier.

@lossendae
Copy link

Bump

@cay89
Copy link

cay89 commented May 31, 2024

If I set phpVersion to 8.3 in the config like this:

"plugins": ["@prettier/plugin-php"],
"phpVersion": "8.3",
"overrides": [
  {
    "files": "*.php",
    "options": {
      "singleQuote": true
    }
  }
]

then the whole "run on save" feature does not work in PhpStorm.

@cseufert
Copy link
Collaborator

Along with static typed constants, we prettier does not read 8.3 as a valid version:

choices: [
{ value: "5.0" },
{ value: "5.1" },
{ value: "5.2" },
{ value: "5.3" },
{ value: "5.4" },
{ value: "5.5" },
{ value: "5.6" },
{ value: "7.0" },
{ value: "7.1" },
{ value: "7.2" },
{ value: "7.3" },
{ value: "7.4" },
{ value: "8.0" },
{ value: "8.1" },
{ value: "8.2" },
],

@cseufert cseufert changed the title PHP 8.3 support Class Constants Types PHP 8.3 support Jun 11, 2024
@cseufert cseufert added this to the PHP 8.3 Support milestone Jun 11, 2024
@Kenneth-Sills
Copy link
Contributor

The upstream parser library doesn't have support for PHP 8(.3) yet. See related ticket. This specific issue is tracked here.

@VladimirBarabash
Copy link

This specific issue is tracked here.

Good news! The specific issue closed last week!

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

7 participants