replace() public method

Replace the byte at the current iterator position with the given string.
public replace ( string $data ) : string
$data string
return string
 public function testApiReplace_ThrowsException_OnInvalidIterator()
 {
     $this->setExpectedException(OutOfBoundsException::class);
     for ($this->iterator->rewind(); $this->iterator->valid(); $this->iterator->next()) {
     }
     $this->iterator->replace($this->appendString);
 }