netbeans icon indicating copy to clipboard operation
netbeans copied to clipboard

PHP parser shows error when calling functions from const

Open terax6669 opened this issue 1 year ago • 0 comments

Apache NetBeans version

Apache NetBeans 21

What happened

Valid PHP code shows error:

image

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

terax6669 avatar Apr 23 '24 10:04 terax6669