Function : array_object

This function converts an array to a stdClass object in which all values are maintained.

Syntax
  array_object($value)
  
  $value: value expected to be converted
   
                  
Sample 1
  $object = array_object(['gender' => 'male']);

  vdump($object->gender); //male
                  
It should be noted that when values which are not of array data type are supplied, the value is returned as supplied:
Sample 2
  $object = array_object(1);

  vdump($object); //1
                  
In order to keep the data supplied as array only, see tostdClass() documentation