php8.5
Home/ Manual/ xdiff / functions/ xdiff_string_bdiff_size

xdiff_string_bdiff_size

PHP function Edit on GitHub ✎

(PECL xdiff >= 1.5.0)

Read a size of file created by applying a binary diff

Description

xdiff_string_bdiff_size(string $patch): int

Returns a size of a result file that would be created after applying binary patch to the original file.

Parameters

patch

The binary patch created by xdiff_string_bdiff() or xdiff_string_rabdiff() function.

Return Values

Returns the size of file that would be created.

Examples

xdiff_string_bdiff_size() example

The following code applies reads a size of file that would be created after applying a binary diff.

php
<?php
$binary_patch = file_get_contents('file.bdiff');
$length = xdiff_string_bdiff_size($binary_patch);
echo "Resulting file will be $length bytes long";
?>

See Also

Source: reference/xdiff/functions/xdiff-string-bdiff-size.xml · from the official PHP manual (php/doc-en)