HomeMenu
Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

is_object

Description

The is_object of Variable Handling for PHP finds whether a variable is an object.

Syntax

is_object(mixed $value): bool

Parameters

value

The variable being evaluated.

Return

Returns true if value is an object, false otherwise.

Examples

1

<?

$value = new stdclass;

$return = is_object($value);

var_dump($value, $return);
object(stdClass)#1 (0) {
}
bool(true)

2

<?

class myclass
{
    function myfunction()
    {
    }
}

$value = new myclass;

$return = is_object($value);

var_dump($value, $return);
object(myclass)#1 (0) {
}
bool(true)