_out[] = $line; $this->_lastWritten = strlen($line); } $newlines--; while ($newlines > 0) { $this->_out[] = ''; $this->_lastWritten = 0; $newlines--; } } /** * Overwrite output already written to the buffer. * * @param array|string $message The message to output. * @param int $newlines Number of newlines to append. * @param int $size The number of bytes to overwrite. Defaults to the * length of the last message output. * @return void */ public function overwrite($message, $newlines = 1, $size = null) { //insert an empty array to mock deletion of existing output $this->_out[] = ""; //append new message to output $this->write($message, $newlines); } /** * Get the buffered output. * * @return array */ public function messages() { return $this->_out; } }