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

Unknown modifier 'n' #1960

Open
sandacode opened this issue Oct 25, 2024 · 0 comments
Open

Unknown modifier 'n' #1960

sandacode opened this issue Oct 25, 2024 · 0 comments

Comments

@sandacode
Copy link

Subject Details
Plugin Php Inspections (EA Extended), 5.1.0
Language level e.g. PHP 8.4 (check project settings or composer.json)

Current behaviour

if(preg_match('/(?<name>\d*)/n', $input, $matches)) {

results in [EA] Unknown modifier 'n'.

Expected behaviour

If Language Level >= PHP 8.2, then n should be treated as a valid modified.
Else continue warning, as this modifier was introduced in PHP 8.2

Nice to have: n should check if the regular expression actually has any named capture groups and warn if it doesn't.

Environment details

Build #PS-243.21155.35, built on October 25, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant