Skip to content

IfAnalyzer incorrectly updates outer scope #9433

@ptomulik

Description

@ptomulik

Consider this example, which correctly reports ReferenceConstraintViolation (dumb inserts into list may introduce discontinuites in indexint turning list into array):

https://psalm.dev/r/461cbad1b2

Now, adding dummy if(isset(...)){}, which has no chance to change flow of control, results with false negative (error disappears):

https://psalm.dev/r/dd0484a239

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