-
Notifications
You must be signed in to change notification settings - Fork 917
Closed
Labels
PHP[ci] enable extra PHP tests (php/php.editor)[ci] enable extra PHP tests (php/php.editor)kind:bugBug report or fixBug report or fix
Milestone
Description
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
class MyClass
{
private int $variable = 1;
function run() : void
{
static $functionResult = rand(); // shows "unexpected '(' after rand" error
static $classVariable = $this->variable; // shows "unexpected '$this' after =" error
}
}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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
PHP[ci] enable extra PHP tests (php/php.editor)[ci] enable extra PHP tests (php/php.editor)kind:bugBug report or fixBug report or fix