class@anonymous::stream_truncate( $new_size )

Source

public function stream_truncate(int $new_size): bool
{
    if ($new_size) {
        $this->data = \substr($this->data, 0, $new_size);
        $this->position = \min($this->position, $new_size);
    } else {
        $this->data = '';
        $this->position = 0;
    }
    return \true;
}

User Contributed Notes

You must log in before being able to contribute a note or feedback.