src/Registry.php
protected function asArray($data)
  {
    $array = [];
    
    foreach(get_object_vars((object)$data) as $k => $v){
      if ( is_object($v) ){
        $array[$k] = $this->asArray($v);
      }
      else {
        $array[$k] = $v;
      }
    }
    
    return $array;
  }
protected function asArray($data)
  {
    $array = [];
    
    foreach(get_object_vars((object)$data) as $k => $v){
      if ( is_object($v) ){
        $array[$k] = $this->asArray($v);
      }
      else {
        $array[$k] = $v;
      }
    }
    
    return $array;
  }
protected function asArray ( $ data ) { $ array = [ ] ; foreach ( get_object_vars ( ( object ) $ data ) as $ k => $ v ) { if ( is_object ( $ v ) ) { $ array [ $ k ] = $ this -> asArray ( $ v ) ; } else { $ array [ $ k ] = $ v ; } } return $ array ; }
Recursively convert an object of data to an array.

@param   object  $data  An object of data to return as an array.
@return   array  Array representation of the input object.
Recursively convert an object of data to an array .