Skip to content

\K must reset matches, false positives since v2.1.11 #12792

@mvorisek

Description

@mvorisek

Bug report

phpstan/phpstan-src#3897 has broken our pipelines as we use \K heavily (https://github.com/atk4/data/actions/runs/14046848345/job/39329419333).

PHPStan can be hotfixed by assuming all regexes containing \K are "not yet understood". But understanding \K is not that dificult, so better variant of fix would be to implement the support right away.

/cc @staabm

Code snippet that reproduces the problem

https://phpstan.org/r/bcf6e7a9-64b3-4bbd-b7d7-fb1c44f0efc8

Expected output

no error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions