prettier / prettier/plugin-php
PHP 8.4's property hooks lead to syntax error
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 1.9k
- Forks
- 139
- PR merge metrics
- No merged PRs in 30d
Description
In v0.24.0:
<?php
class Foo {
public string $bar {
get { return $this->bar; }
}
}
SyntaxError: Parse Error : syntax error, unexpected '{' on line 4
No playground link because the playground supports neither PHP 8.4 nor v0.24.0 of the plugin. Edit: It does now: https://loilo.github.io/prettier-php-playground/#N4IgDgTgpgLjCWUIHkwIPYDsDOIBcok8mMA6vACYwAW+AHAAwA0IMAhgEblW14AsLAK7YoAFU648AMzYAbES2zEA5rKgBFQehhR8M+VBZhqYAGpIlWfCDoA6PiBYwIbeLJUBhdAFtvbAAoAEv74zoKGIBwuAMZQAMowAJ5q1mBIALTRuCzQAI6C8ND+Lsp+enIKIMQiEDDFbKVs5QYAvixQFPAw6Cho8FiSoGzYMM0ibVWYYIKjeCAAPAD8xmAAOpjr0bLD2AAEAGLo6LvA67vnu9Mc7tG7IxAquwAkHGwQJ2cXX8qwJ7vQMEEEEwzxo8Gw6QAfK8IABuXYtT7nRGYFogFpAA
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the syntax error with the PHP 8.4 property-hooks example in the linked Prettier PHP playground, then trace the parser entry point handling that syntax. Done means the example formats successfully without a syntax error, with regression coverage added in the repository's existing test structure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 64/100