Skip to content

Incorrect number of sscanf placeholders detected #64

@spaze

Description

@spaze

sscanf has an "additional" way of specifying strings using regex-like character classes. It's handy when parsing strings with non-space separators. These character classes are not correctly detected by PHPStan.

sscanf call like the following one throws Call to sscanf contains 1 placeholder, 3 values given.

sscanf('foo,bar,2600', '%20[^,],%20[^,],%d', $foo, $bar, $baz);

but it's actually a correct sscanf call, see https://3v4l.org/PNEok (also explains the character classes thing)

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