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

regex-matching: infer constant strings from zero-or-one quantification #14820

Description

@staabm

Feature request

when single constant tokens like b are used with ?-quantifier we should infer it as a constant 'b'|'' union type so it can be used to infer constant strings with sorrounding literals

see https://phpstan.org/r/41789fd6-3d78-4a39-b34f-c9d46e08c84c

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

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions