apache / apache/netbeans

[PHP] Accessing undeclared/inaccessible static property must produce error

Open
#6,019 0 comments 0 reactions 0 assignees View on GitHub
kind:feature needs:triage PHP
Dominant language
Java
Stars
3.1k
Forks
935
Avg merge
2d 3h
Merged PRs (30d)
17

Description

### Apache NetBeans version

Apache NetBeans 18

### What happened

Accessing undeclared static property must produce error.
Error type: runtime error.

### How to reproduce

```php
fnInstance();
myFunc($ins);
MyClass2::fnStatic();
(new MyClass2)->fnInstance();
```

### Did this work correctly in an earlier version?

No / Don't know

### Operating System

Windows 10

### JDK

Java: 14.0.1; Java HotSpot(TM) 64-Bit Server VM 14.0.1+7 Runtime: Java(TM) SE Runtime Environment 14.0.1+7

### Apache NetBeans packaging

Apache NetBeans binary zip

### Anything else

_No response_

### Are you willing to submit a pull request?

No

Contributor guide

Open the contributing guide

Research direction

Start by running the supplied PHP reproduction in NetBeans 18 and locating the PHP analysis or diagnostic entry point for static-property access. Compare declared, inaccessible, and undeclared cases across static, self, and instance forms; done means each marked “must display error” produces an error while the marked OK cases remain valid.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
devtools
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.