-
Notifications
You must be signed in to change notification settings - Fork 861
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
PHP 8.3 Lazy static initialization for non constants #8073
Milestone
Comments
Wukkopi
added
kind:bug
Bug report or fix
needs:triage
Requires attention from one of the committers
labels
Dec 18, 2024
Thanks for reporting it. https://wiki.php.net/rfc/arbitrary_static_variable_initializers |
junichi11
added a commit
to junichi11/netbeans
that referenced
this issue
Dec 23, 2024
- apache#6701 - apache#8073 - https://wiki.php.net/rfc/arbitrary_static_variable_initializers - Fix the grammar file (parser) - Add unit tests for the parser Example: ```php class Example { private int $field = 1; public function method(): int { return 1; } public function run(int $param1) : void { static $example1 = rand(); static $example2 = $param1; static $example3 = $this->field; static $example4 = $this->method(); static $example5 = new class() {}; static $example6 = new stdClass(...[0]); static $example6 = new stdClass($param1); static $example7 = new (Test); static $example8 = new static; static $example9 = $param1 <= 100 ? run($param1 + 1) : "Test $param1"; static $example10 = rand(), $example11 = rand(); } } $variable = 1; static $example1 = rand(); static $example2 = $variable; ```
junichi11
added a commit
to junichi11/netbeans
that referenced
this issue
Dec 23, 2024
- apache#6701 - apache#8073 - https://wiki.php.net/rfc/arbitrary_static_variable_initializers - Fix the formatter - Add unit tests - Formatter - Code Completion - GotoDeclaration and MarkOccurrences
junichi11
added a commit
to junichi11/netbeans
that referenced
this issue
Dec 23, 2024
- apache#6701 - apache#8073 - https://wiki.php.net/rfc/arbitrary_static_variable_initializers - Fix the `PHP83UnhandledError` - Fix the bracket barance for the `ASTPHP5Scanner` - Add unit tests for the scanner
@Wukkopi It would be nice if you can test a dev version: https://github.com/apache/netbeans/suites/32363378994/artifacts/2354210960 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Apache NetBeans version
Apache NetBeans 24
What happened
I'm getting syntax error on valid syntax when language level is on 8.3.
Since PHP 8.3 lazy static initialization happens during runtime instead of compile time, allowing non-constants to be assigned (functions, and even class variables).
Language / Project Type / NetBeans Component
No response
How to reproduce
Did this work correctly in an earlier version?
No / Don't know
Operating System
Debian 12
JDK
OpenJDK 64-Bit Server VM (build 17.0.13+11-Debian-2deb12u1, mixed mode, sharing)
Apache NetBeans packaging
Apache NetBeans binary zip
Anything else
No response
Are you willing to submit a pull request?
No
The text was updated successfully, but these errors were encountered: