PHP get_mangled_object_vars() Function Last Updated : 28 Apr, 2025 Comments Improve Suggest changes Like Article Like Report The get_mangled_object_vars() function is an inbuilt function in PHP which is used to return an array of mangled object properties. This function returns an array whose elements are the properties of an object. The keys are the member variable. Syntax: array get_mangled_object_vars(object $object) Parameters: This function accepts one parameter that is described below: $object: This parameter specifies an object instance. Return Value: It returns an array containing all properties, regardless of visibility, of an object. Example 1: This example demonstrates the get_mangled_object_vars() function. PHP <?php class Articles { public $public = 1; protected $protected = 2; private $private = 3; } class GeeksforGeeks extends Articles { private $private = 4; } $object = new GeeksforGeeks ; $object->dynamic = 5 ; $object->{'6'} = 5 ; var_dump(get_mangled_object_vars($object)); ?> Output: array(6) { ["public"]=> int(1) ["*protected"]=> int(2) ["Articlesprivate"]=> int(3) ["GeeksforGeeksprivate"]=> int(4) ["dynamic"]=> int(5) [6]=> int(5) } Example 2: This is another example that demonstrates the get_mangled_function() method. PHP <?php class AO extends ArrayObject { private $private = 1; } $arrayObject = new AO(['x' => 'y']); $arrayObject->dynamic = 2; var_dump(get_mangled_object_vars($arrayObject)); ?> Output: array(2) { ["AOprivate"]=> int(1) ["dynamic"]=> int(2) } Reference: https://www.php.net/manual/en/function.get-mangled-object-vars.php Comment More infoAdvertise with us Next Article PHP get_mangled_object_vars() Function N neeraj3304 Follow Improve Article Tags : PHP PHP-function PHP-Classes/Object-Functions Similar Reads PHP | get_object_vars() Function The get_object_vars() function is an inbuilt function in PHP that is used to get the properties of the given object. When an object is made, it has some properties. An associative array of properties of the mentioned object is returned by the function. But if there is no property of the object, then 2 min read PHP | is_object() Function 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 1 min read PHP get_class_vars() Function The get_class_vars() function is an inbuilt function in PHP which is used to get the default properties of a class. Syntax: array get_class_vars(string $class)Parameters: This function accepts one parameter that is described below: $class: This parameter specifies the name of the class.Return Value: 1 min read PHP | get_defined_vars() Function The get_defined_vars() function is an inbuilt function in PHP which is used to returns an array of all defined variables. This function returns a multidimensional array which contains all the list of variables, environment etc. Syntax: array get_defined_vars( void ) Parameters: This function does no 1 min read PHP ob_get_clean() Function The ob_get_clean() function is an in-built PHP function that is used to clean or delete the current output buffer. It's also used to get the output buffering again after cleaning the buffer. The ob_get_clean() function is the combination of both ob_get_contents() and ob_end_clean(). Syntax: string|f 2 min read Like