🌐 US-Proxy
class="logged-out env-production page-responsive" style="word-wrap: break-word;" >
Skip to content

Nested captured optional subpatterns result in non-falsy-string instead of string #14809

Description

@tacovandenbroek

Bug report

When nesting capturing subpatterns that have both empty and non-empty branches, phpstan assumes the resulting type is non-falsy-string, instead of string.

Code snippet that reproduces the problem

https://phpstan.org/r/8c787e73-b367-4dfb-9a6f-0c5eacae72a2

Expected output

"No errors!"

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions