public function replaceByIndex($offset, $name = null)
    {
        if (!isset($this->elements[$offset])) {
            throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
        }

        if (null !== $name) {
            $this->elements[$offset] = $name;
        }

        $this->isIndex[$offset] = true;
    }
public function replaceByIndex($offset, $name = null)
    {
        if (!isset($this->elements[$offset])) {
            throw new OutOfBoundsException(sprintf('The offset %s is not within the property path', $offset));
        }

        if (null !== $name) {
            $this->elements[$offset] = $name;
        }

        $this->isIndex[$offset] = true;
    }
public function replaceByIndex ( $ offset , $ name = null ) { if ( ! isset ( $ this -> elements [ $ offset ] ) ) { throw new OutOfBoundsException ( sprintf ( 'The offset %s is not within the property path' , $ offset ) ) ; } if ( null !== $ name ) { $ this -> elements [ $ offset ] = $ name ; } $ this -> isIndex [ $ offset ] = true ; }
Replaces a property element by an index element.

@param int    $offset The offset at which to replace
@param string $name   The new name of the element. Optional

@throws OutOfBoundsException If the offset is invalid
Replaces a property element by an index element .