Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP is_object() Function

PHP is_object() Function

PHP Available FunctionsAvailable PHP Functions

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:

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"
}

PHP Available FunctionsAvailable PHP Functions