Skip to content

Undefined variables in string interpolation are not being caught #5331

@Ocramius

Description

@Ocramius

Taken from the convo @ https://twitter.com/mattbrowndev/status/1367965245084491783 (sorry, I just happen to review too much code :| )

<?php

(function () : void {
    echo (fn(string $b) => "$b - $undefined")("hello");
})();

https://psalm.dev/r/d5662fa596

It should report $undefined as undefined, but it doesn't.

See https://3v4l.org/D8tJR for runtime verification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions