original_string: public function slice(int $offset, int $length = null)
      {
          $actions = $this->internalDataListActions;
          $actions[] = ['slice', $offset, $length];
          $data = $this->internalDataListUpdateData($this->internalDataListData, $actions);
          $slice = array_slice($data, $offset, $length);
          $className = get_class($this);
          $list = new $className();
          foreach ($slice as $object) {
              $list->push($object);
          }
          return $list;
      }
code: public function slice(int $offset, int $length = null)
      {
          $actions = $this->internalDataListActions;
          $actions[] = ['slice', $offset, $length];
          $data = $this->internalDataListUpdateData($this->internalDataListData, $actions);
          $slice = array_slice($data, $offset, $length);
          $className = get_class($this);
          $list = new $className();
          foreach ($slice as $object) {
              $list->push($object);
          }
          return $list;
      }
code_tokens: public function slice ( int $ offset , int $ length = null ) { $ actions = $ this -> internalDataListActions ; $ actions [ ] = [ 'slice' , $ offset , $ length ] ; $ data = $ this -> internalDataListUpdateData ( $ this -> internalDataListData , $ actions ) ; $ slice = array_slice ( $ data , $ offset , $ length ) ; $ className = get_class ( $ this ) ; $ list = new $ className ( ) ; foreach ( $ slice as $ object ) { $ list -> push ( $ object ) ; } return $ list ; }
docstring: Extract a slice of the list.
  
  @param int $offset The index position where the extraction should begin
  @param int $length The max length of the items in the extracted slice.
  @return mixed Returns a slice of the list.
  @throws \InvalidArgumentException
docstring_tokens: Extract a slice of the list .