property_exists

Supported Versions: PHP 5 >= 5.1.0, PHP 7, PHP 8
Checks if the object or class has a property
<?php property_exists(object|string $object_or_class, string $property): bool
<?php     public function maxAttempts()

    {

        return property_exists($this, 'maxAttempts') ? $this->maxAttempts : 5;

    }
<?php     public function decayMinutes()

    {

        return property_exists($this, 'decayMinutes') ? $this->decayMinutes : 1;

    }

}
<?php     public function __call($method, $args)

    {

        if (! property_exists($this, $method)) {

            throw new \Exception(sprintf('Call to undefined method %s::%s', get_class($this), $method));

        }