Skip to content

property_exists called with string #2221

@mabar

Description

@mabar
<?php declare(strict_types = 1);

class HelloWorld
{
	public $foo;
}

var_dump(property_exists(HelloWorld::class, 'foo'));

For given code got Call to function property_exists() with 'HelloWorld' and 'foo' will always evaluate to false., while it returns true.

https://phpstan.org/r/038713cf-450f-48d4-b52f-e8b81440f68b
http://sandbox.onlinephpfunctions.com/code/9dac9675bfa08190c3e6e1d4766d6cad398e05b0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions