[PECL-CVS] [pecl-text-xdiff] main: better syntax highlighting
[email protected] (Rasmus Lerdorf) Tue, 7 Apr 2026 11:50:02 +0000
| Newsgroups | php.pecl.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: Rasmus Lerdorf (rlerdorf)
Date: 2026-04-07T07:49:56-04:00
Commit: https://github.com/php/pecl-text-xdiff/commit/82c47f7e28ae253cd3cba87b4dd111026afe0439
Raw diff: https://github.com/php/pecl-text-xdiff/commit/82c47f7e28ae253cd3cba87b4dd111026afe0439.diff
better syntax highlighting
Changed paths:
M README.md
Diff:
diff --git a/README.md b/README.md
index ea59552..73f69c1 100644
--- a/README.md
+++ b/README.md
@@ -32,37 +32,37 @@ make install
### Diff
```php
-xdiff_string_diff(string $str1, string $str2, int $context = 3, bool $minimal = false): string|false
+function xdiff_string_diff(string $str1, string $str2, int $context = 3, bool $minimal = false): string|false {}
```
Creates a unified diff of two strings. `$context` sets the number of surrounding lines. `$minimal` reduces diff size at the cost of speed.
```php
-xdiff_file_diff(string $file1, string $file2, string $dest, int $context = 3, bool $minimal = false): bool
+function xdiff_file_diff(string $file1, string $file2, string $dest, int $context = 3, bool $minimal = false): bool {}
```
Creates a unified diff of two files and writes the result to `$dest`.
```php
-xdiff_string_diff_binary(string $str1, string $str2): string|false
+function xdiff_string_diff_binary(string $str1, string $str2): string|false {}
```
Creates a binary diff of two strings.
```php
-xdiff_file_diff_binary(string $file1, string $file2, string $dest): bool
+function xdiff_file_diff_binary(string $file1, string $file2, string $dest): bool {}
```
Creates a binary diff of two files and writes the result to `$dest`.
```php
-xdiff_string_rabdiff(string $str1, string $str2): string|false
+function xdiff_string_rabdiff(string $str1, string $str2): string|false {}
```
Creates a binary diff of two strings using the Rabin fingerprint algorithm.
```php
-xdiff_file_rabdiff(string $file1, string $file2, string $dest): bool
+function xdiff_file_rabdiff(string $file1, string $file2, string $dest): bool {}
```
Creates a binary diff of two files using the Rabin fingerprint algorithm and writes the result to `$dest`.
@@ -70,7 +70,7 @@ Creates a binary diff of two files using the Rabin fingerprint algorithm and wri
### Patch
```php
-xdiff_string_patch(string $file, string $patch, int $flags = XDIFF_PATCH_NORMAL, ?string &$error = null): string|bool
+function xdiff_string_patch(string $file, string $patch, int $flags = XDIFF_PATCH_NORMAL, ?string &$error = null): string|bool {}
```
Applies a unified patch to a string. Returns the patched string, or `false` on error. Rejected chunks are returned via `$error`.
@@ -78,19 +78,19 @@ Applies a unified patch to a string. Returns the patched string, or `false` on e
`$flags`: `XDIFF_PATCH_NORMAL` (default) or `XDIFF_PATCH_REVERSE`.
```php
-xdiff_file_patch(string $file, string $patch, string $dest, int $flags = XDIFF_PATCH_NORMAL): string|bool
+function xdiff_file_patch(string $file, string $patch, string $dest, int $flags = XDIFF_PATCH_NORMAL): string|bool {}
```
Applies a unified patch from a file. Returns `true` on success, a string of rejected chunks on partial failure, or `false` on error.
```php
-xdiff_string_patch_binary(string $str, string $patch): string|false
+function xdiff_string_patch_binary(string $str, string $patch): string|false {}
```
Applies a binary patch to a string. Works with both bdiff and rabdiff patches.
```php
-xdiff_file_patch_binary(string $file, string $patch, string $dest): bool
+function xdiff_file_patch_binary(string $file, string $patch, string $dest): bool {}
```
Applies a binary patch from a file and writes the result to `$dest`.
@@ -98,13 +98,13 @@ Applies a binary patch from a file and writes the result to `$dest`.
### Merge
```php
-xdiff_string_merge3(string $str1, string $str2, string $str3, ?string &$error = null): string|bool
+function xdiff_string_merge3(string $str1, string $str2, string $str3, ?string &$error = null): string|bool {}
```
Three-way merge of strings. Returns the merged string, or `false` on error. Conflicts are returned via `$error`.
```php
-xdiff_file_merge3(string $file1, string $file2, string $file3, string $dest): string|bool
+function xdiff_file_merge3(string $file1, string $file2, string $file3, string $dest): string|bool {}
```
Three-way merge of files. Returns `true` on success, a string of rejected chunks on conflict, or `false` on error.
@@ -112,13 +112,13 @@ Three-way merge of files. Returns `true` on success, a string of rejected chunks
### Binary diff size
```php
-xdiff_string_bdiff_size(string $patch): int|false
+function xdiff_string_bdiff_size(string $patch): int|false {}
```
Returns the size of the file that would be created by applying the given binary patch.
```php
-xdiff_file_bdiff_size(string $patch_file): int|false
+function xdiff_file_bdiff_size(string $patch_file): int|false {}
```
Same as above, but reads the patch from a file.