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));
    }
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));
    }
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 ) ) ; }
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.
Replace a section of this path s name with the supplied name atom sequence .