Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP parser shows error when calling functions from const #7322

Open
terax6669 opened this issue Apr 23, 2024 · 0 comments
Open

PHP parser shows error when calling functions from const #7322

terax6669 opened this issue Apr 23, 2024 · 0 comments
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers PHP [ci] enable extra PHP tests (php/php.editor)

Comments

@terax6669
Copy link

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 terax6669 added kind:bug Bug report or fix needs:triage Requires attention from one of the committers labels Apr 23, 2024
@troizet troizet added the PHP [ci] enable extra PHP tests (php/php.editor) label Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind:bug Bug report or fix needs:triage Requires attention from one of the committers PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

No branches or pull requests

2 participants