PHP | is_object() Function Last Updated : 27 Apr, 2020 Comments Improve Suggest changes Like Article Like Report 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 <?php // Create a class class GFG { public $data1; public $data2; public $data3; } // Create an object $obj = new GFG(); // Check the value of variable // is an object or not if(is_object($obj)) { echo "Object"; } else { echo "Not Object"; } ?> Output: Object Program 2: php <?php // Create a class class GFG { public $Geek_name = "Welcome to GeeksforGeeks"; } // Create the class name alias class_alias('GFG', 'GeeksforGeeks'); $obj1 = new GFG(); $obj2 = new GeeksforGeeks(); $obj3 = 'GeeksforGeeks'; var_dump(is_object($obj1)); var_dump(is_object($obj2)); var_dump(is_object($obj3)); ?> Output: bool(true) bool(true) bool(false) Reference: https://www.php.net/manual/en/function.is-object.php Create Quiz Comment A ashokjaiswal Follow 0 Improve A ashokjaiswal Follow 0 Improve Article Tags : Web Technologies PHP PHP-function Explore BasicsPHP Syntax4 min readPHP Variables5 min readPHP | Functions6 min readPHP Loops4 min readArrayPHP Arrays5 min readPHP Associative Arrays4 min readMultidimensional arrays in PHP5 min readSorting Arrays in PHP4 min readOOPs & InterfacesPHP Classes2 min readPHP | Constructors and Destructors5 min readPHP Access Modifiers4 min readMultiple Inheritance in PHP4 min readMySQL DatabasePHP | MySQL Database Introduction4 min readPHP Database connection2 min readPHP | MySQL ( Creating Database )3 min readPHP | MySQL ( Creating Table )3 min readPHP AdvancePHP Superglobals6 min readPHP | Regular Expressions12 min readPHP Form Handling4 min readPHP File Handling4 min readPHP | Uploading File3 min readPHP Cookies9 min readPHP | Sessions7 min read Like