Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Wrong function signature for array_key_exists() #13505

@pprkut

Description

@pprkut

Bug report

phpstan complains that array_key_exists() expects int|string for $key, but on php.net it's documented as string|int|float|bool|resource|null

https://www.php.net/manual/en/function.array-key-exists.php

This was changed from int|string for PHP 8.0.0 in php/doc-en#3135

Code snippet that reproduces the problem

https://phpstan.org/r/29df4267-f360-49ed-8dfd-a1f52e5e2e07

Expected output

The always evaluate to true/false comments may be valid, but it should not complain about the type for $key

Did PHPStan help you today? Did it make you happy in any way?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions