apache / apache/netbeans

PHP parser shows error when calling functions from const

Open
#7,322 0 comments 0 reactions 0 assignees View on GitHub
kind:bug 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 21

### What happened

Valid PHP code shows error:

![image](https://github.com/apache/netbeans/assets/19204073/26b277a2-b0b7-45e2-a1e1-1bcf7fd7889f)

### Language / Project Type / NetBeans Component

PHP

### How to reproduce

```php
'is_bool',
];

private function verifyTypes(string $type, mixed $value, array &$invalidTypes, int $level = 0): bool
{
return isset(self::VALIDATION_FUNCTIONS[$type]) ? self::VALIDATION_FUNCTIONS[$type]($value) : $value instanceof $type;
}
}
```

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

No / Don't know

### Operating System

macOS 14.4.1

### JDK

openjdk version "21.0.2" 2024-01-16

### Apache NetBeans packaging

Apache NetBeans provided installer

### Anything else

_No response_

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

No

Contributor guide

Open the contributing guide

Research direction

Open the provided PHP snippet in Apache NetBeans 21 and reproduce the parser error in the PHP editor. Trace the PHP parser or inspection responsible for rejecting the callable retrieved from the class constant. Done means this valid example no longer shows a parser error.

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
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.