original_string: public static function export($data)
      {
          if (is_object($data)) {
              //	Allow embedded export method for specific export
              if ($data instanceof Arrayable || method_exists($data, 'toArray')) {
                  $data = $data->toArray();
              } else {
                  $data = get_object_vars($data);
              }
          }
  
          if (!is_array($data)) {
              return $data;
          }
  
          $output = [];
  
          foreach ($data as $key => $value) {
              $output[$key] = static::export($value);
          }
  
          return $output;
      }
code: public static function export($data)
      {
          if (is_object($data)) {
              //	Allow embedded export method for specific export
              if ($data instanceof Arrayable || method_exists($data, 'toArray')) {
                  $data = $data->toArray();
              } else {
                  $data = get_object_vars($data);
              }
          }
  
          if (!is_array($data)) {
              return $data;
          }
  
          $output = [];
  
          foreach ($data as $key => $value) {
              $output[$key] = static::export($value);
          }
  
          return $output;
      }
code_tokens: public static function export ( $ data ) { if ( is_object ( $ data ) ) { //	Allow embedded export method for specific export if ( $ data instanceof Arrayable || method_exists ( $ data , 'toArray' ) ) { $ data = $ data -> toArray ( ) ; } else { $ data = get_object_vars ( $ data ) ; } } if ( ! is_array ( $ data ) ) { return $ data ; } $ output = [ ] ; foreach ( $ data as $ key => $ value ) { $ output [ $ key ] = static :: export ( $ value ) ; } return $ output ; }
docstring: Build the array from data.
  
  @param mixed $data
  
  @return mixed
docstring_tokens: Build the array from data .