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

TooManyArguments - preg_match_all with $offset triggers issue #4202

Closed
ppdeblieck opened this issue Sep 17, 2020 · 1 comment
Closed

TooManyArguments - preg_match_all with $offset triggers issue #4202

ppdeblieck opened this issue Sep 17, 2020 · 1 comment
Labels

Comments

@ppdeblieck
Copy link
Contributor

preg_match_all allows up to 5 parameters. preg_match_all('@a+@', 'aa bb cc', $matches, PREG_PATTERN_ORDER, 1); triggers a false positive TooManyArguments.

See: https://psalm.dev/r/4ff0dfe9ec

@psalm-github-bot
Copy link

I found these snippets:

https://psalm.dev/r/4ff0dfe9ec
<?php

preg_match_all('@a+@', 'aa bb cc', $matches, PREG_PATTERN_ORDER, 1);
Psalm output (using commit 7d5dbd3):

ERROR: TooManyArguments - 3:1 - Too many arguments for preg_match_all - expecting 4 but saw 5

@muglug muglug added the bug label Sep 18, 2020
@muglug muglug closed this as completed in 363887a Sep 18, 2020
muglug added a commit that referenced this issue Oct 7, 2020
danog pushed a commit to danog/psalm that referenced this issue Jan 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants