PHP Tutorial - PHP is_object() function






is_object(value) returns true if value is an object.

Syntax

is_object(value)

Parameter

  • value is the variable being type checked.

Return

Returns true if value is an object.





Example

Is it an object.


<?php
$values = array(2, "2", 2.5, "2.5", null, true);

var_dump(is_object($values));


?>

The code above generates the following result.