netbeans
netbeans copied to clipboard
PHP parser shows error when calling functions from const
Apache NetBeans version
Apache NetBeans 21
What happened
Valid PHP code shows error:
Language / Project Type / NetBeans Component
PHP
How to reproduce
<?php
class Foo
{
private const VALIDATION_FUNCTIONS = [
'bool' => '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