code: public function toArray($recursive = false)
      {
          if ($recursive) {
              return $this->recursiveToArray($this);
          }
  
          $tmp = (array) $this;
  
          if ($this->loc) {
              $tmp['loc'] = [
                  'start' => $this->loc->start,
                  'end'   => $this->loc->end,
              ];
          }
  
          return $tmp;
      }
docs: @param bool $recursive
  
  @return mixed[]