original_string: public function replaceNameAtoms($index, $replacement, $length = null)
      {
          $atoms = $this->nameAtoms();
  
          if (!is_array($replacement)) {
              $replacement = iterator_to_array($replacement);
          }
          if (null === $length) {
              $length = count($atoms);
          }
  
          array_splice($atoms, $index, $length, $replacement);
  
          return $this->replaceName(implode(self::EXTENSION_SEPARATOR, $atoms));
      }
code: public function replaceNameAtoms($index, $replacement, $length = null)
      {
          $atoms = $this->nameAtoms();
  
          if (!is_array($replacement)) {
              $replacement = iterator_to_array($replacement);
          }
          if (null === $length) {
              $length = count($atoms);
          }
  
          array_splice($atoms, $index, $length, $replacement);
  
          return $this->replaceName(implode(self::EXTENSION_SEPARATOR, $atoms));
      }
code_tokens: public function replaceNameAtoms ( $ index , $ replacement , $ length = null ) { $ atoms = $ this -> nameAtoms ( ) ; if ( ! is_array ( $ replacement ) ) { $ replacement = iterator_to_array ( $ replacement ) ; } if ( null === $ length ) { $ length = count ( $ atoms ) ; } array_splice ( $ atoms , $ index , $ length , $ replacement ) ; return $ this -> replaceName ( implode ( self :: EXTENSION_SEPARATOR , $ atoms ) ) ; }
docstring: Replace a section of this path's name with the supplied name atom
  sequence.
  
  @param integer       $index       The start index of the replacement.
  @param mixed<string> $replacement The replacement name atom sequence.
  @param integer|null  $length      The number of atoms to replace. If $length is null, the entire remainder of the path name will be replaced.
  
  @return PathInterface A new path instance that has a portion of this name's atoms replaced with a different sequence of atoms.
docstring_tokens: Replace a section of this path s name with the supplied name atom sequence .