original_string: private static function toArrayRecursive($object)
      {
          $output = get_object_vars($object);
  
          foreach ($output as $key => $value) {
              if ($value instanceof \DateTime) {
                  $output[$key] = $value->format('c');
              } elseif (is_object($value)) {
                  $output[$key] = static::toArrayRecursive($value);
              }
          }
  
          return $output;
      }
code: private static function toArrayRecursive($object)
      {
          $output = get_object_vars($object);
  
          foreach ($output as $key => $value) {
              if ($value instanceof \DateTime) {
                  $output[$key] = $value->format('c');
              } elseif (is_object($value)) {
                  $output[$key] = static::toArrayRecursive($value);
              }
          }
  
          return $output;
      }
code_tokens: private static function toArrayRecursive ( $ object ) { $ output = get_object_vars ( $ object ) ; foreach ( $ output as $ key => $ value ) { if ( $ value instanceof \ DateTime ) { $ output [ $ key ] = $ value -> format ( 'c' ) ; } elseif ( is_object ( $ value ) ) { $ output [ $ key ] = static :: toArrayRecursive ( $ value ) ; } } return $ output ; }
docstring: Recursively cast an object into an array.
  @param mixed $object
  @return mixed[]
docstring_tokens: Recursively cast an object into an array .