<?php stream_copy_to_stream( resource $from, resource $to, ?int $length = null, int $offset = 0): int|false
<?php private function copyStreamToStream($source, $target): void { if (@stream_copy_to_stream($source, $target) === false) { throw CannotCopyStreamToStream::new(error_get_last()); } }