Skip to content

isset/empty wrongly considered as callable #6014

@villfa

Description

@villfa

Bug report

empty() and isset() are considered as callable by PHPStan while they're not.

Code snippet that reproduces the problem

https://3v4l.org/iMgPt

<?php
var_dump(is_callable('empty')); // bool(false)
var_dump(is_callable('isset')); // bool(false)

https://phpstan.org/r/c8e58374-a244-41c8-927c-1905a945389e

Call to function is_callable() with 'empty' will always evaluate to true.
Call to function is_callable() with 'isset' will always evaluate to true.

Expected output

Call to function is_callable() with 'empty' will always evaluate to false.
Call to function is_callable() with 'isset' will always evaluate to false.

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

PHPStan is an awesome tool. Thanks for your work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions