Bug report
@staabm another one.. I am not sure how easy to fix but technically something inside a pattern that is preg_quoted is safe (as long as the pattern delimiter are metacharacters, or curly/square braces/parenthesis).
So the above pattern in the reproducer could be processed just like the second one (well I guess the return value of preg_quote should be assumed to be '' for string and 'x' for non-empty-string, for safety in further regex pattern processing we don't want to mark something as not empty if we are not sure like '#('.preg_quote('').')#' might be matching nothing).
Code snippet that reproduces the problem
https://phpstan.org/r/c2d6118d-b040-42e4-a5b1-ec4fb0f48fd3
Expected output
See above
Did PHPStan help you today? Did it make you happy in any way?
No response
Bug report
@staabm another one.. I am not sure how easy to fix but technically something inside a pattern that is preg_quoted is safe (as long as the pattern delimiter are metacharacters, or curly/square braces/parenthesis).
So the above pattern in the reproducer could be processed just like the second one (well I guess the return value of preg_quote should be assumed to be
''for string and'x'for non-empty-string, for safety in further regex pattern processing we don't want to mark something as not empty if we are not sure like'#('.preg_quote('').')#'might be matching nothing).Code snippet that reproduces the problem
https://phpstan.org/r/c2d6118d-b040-42e4-a5b1-ec4fb0f48fd3
Expected output
See above
Did PHPStan help you today? Did it make you happy in any way?
No response