Skip to content

sscanf array bug #7764

@Alkarex

Description

@Alkarex

PHPStan seems to assume that sscanf() returns an array of size 1.

Since PHPStan 1.7.15 (no problem with 1.7.14). Could be due to phpstan/phpstan-src#1434

Code snippet that reproduces the problem

https://phpstan.org/r/99167899-8984-4874-b79d-8834ff508aa9

image

Running that code in PHP returns:

Success
Array
(
    [0] => hello
    [1] => world
    [2] => 
)

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