Skip to content

json_decode second parameter should be nullable #7887

@webmaster777

Description

@webmaster777

I'm getting this error only under php 7.4:

$json = \json_decode($json, null, 512, JSON_THROW_ON_ERROR);

phpstan (1.8.2) will report:

 Parameter #2 $assoc of function json_decode expects bool, null given.

It is nullable since php 7.3, but I'm not sure which version resources/functionMap.php is supposed to reflect, and there is no functionMap_php73delta.php file.

I'll create a PR for updating resources/functionMap.php with widened parameter type

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