PHP is_object() Function
is_object() The function is used to check whether a variable is an object.
PHP version requirement: PHP 4, PHP 5, PHP 7
Syntax
bool is_object ( mixed $var )
Parameter Description:
- $var: the variable to check.
Return Value
If the specified variable is an object, returns TRUE; otherwise returns FALSE.
Example
Example
subjects ) ; } $obj_name = new stdClass ; $obj_name -> subjects = Array ( ' Google ' , ' Runoob ' , ' Facebook ' ) ; var_dump ( get_subjects ( NULL ) ) ; var_dump ( get_subjects ( $obj_name ) ) ; ?>The output is:
bool(false)
array(3) {
[0]=>
string(6) "Google"
[1]=>
string(6) "Runoob"
[2]=>
string(8) "Facebook"
}
Available PHP Functions