src/Structures/Buffer.php
public function replace($search, $replace): int
    {
        $this->data = str_replace($search, $replace, $this->data, $count);
        
        return $count;
    }
public function replace($search, $replace): int
    {
        $this->data = str_replace($search, $replace, $this->data, $count);
        
        return $count;
    }
Replaces all occurences of $search with $replace. See str_replace() function.

@param mixed $search
@param mixed $replace

@return int Number of replacements performed.