You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Regex matches should have array shape if the regex is known #9502
The returned value can still be false even if the regex is valid. This has definitely been discussed somewhere on the issue tracker. There might even have been a PR.
The returned value can still be false even if the regex is valid. This has definitely been discussed somewhere on the issue tracker. There might even have been a PR.
false is returned for example for every invalid UTF-8 input when u PCRE modifier is used
The returned value can still be false even if the regex is valid. This has definitely been discussed somewhere on the issue tracker. There might even have been a PR.
Sorry, I looked for multiple issues and tried to find the discussion but didn't find it before asking it.
Activity
staabm commentedon Jun 24, 2023
PHPStan already contains a regex AST parser, which could be used for a even more precise typing
VincentLanglet commentedon Feb 5, 2024
Hi @mvorisek @staabm,
As a first easy step shouldn't we remove the FALSE return type from
preg_*call if the regex is valid ?https://phpstan.org/r/a4de9bb6-e99d-438b-bcb1-17335d0b3608
Do you have in mind
FALSEreturn value with a valid regex or could we create a dynamicReturnTypeExtension which@preg_match()on the constant values?
ondrejmirtes commentedon Feb 5, 2024
The returned value can still be false even if the regex is valid. This has definitely been discussed somewhere on the issue tracker. There might even have been a PR.
staabm commentedon Feb 5, 2024
Removing false was discussed in the past in some issue somewhere. A valid regex is not the only case where false is returned
mvorisek commentedon Feb 5, 2024
falseis returned for example for every invalid UTF-8 input whenuPCRE modifier is usedVincentLanglet commentedon Feb 5, 2024
Sorry, I looked for multiple issues and tried to find the discussion but didn't find it before asking it.
Thanks for the quick answer !
staabm commentedon Jul 3, 2024
@ondrejmirtes this issue can be closed
ondrejmirtes commentedon Jul 3, 2024
Thanks
github-actions commentedon Aug 4, 2024
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.