PHP | is_object() Function (original) (raw)
Last Updated : 27 Apr, 2020
The is_object() function is an inbuilt function in PHP which is used to check whether the given value is an object or not.Syntax:
bool is_object( mixed $var )
Parameters: This function accepts single parameter as mentioned above and described below:
- $var: It contains the value of variable that need to be check.
Return Value: It returns TRUE if the value of variable is an object, FALSE otherwise. Program 1:
php `
`
Output:
Object
Program 2:
php `
`
Output:
bool(true) bool(true) bool(false)
Reference: https://www.php.net/manual/en/function.is-object.php