is_object

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)

boolval

debug_zval_dump

doubleval

empty

floatval

get_debug_type

get_defined_vars

get_resource_id

get_resource_type

gettype

intval

is_array

is_bool

is_callable

is_countable

is_double

is_float

is_int

is_integer

is_iterable

is_long

is_null

is_numeric

is_real

is_resource

is_scalar

is_string

isset

print_r

serialize

settype

strval

unserialize

unset

var_dump

var_export

PHP

Home Menu