PHP-Implementation

210 views
Skip to first unread message

Tobi

unread,
Dec 22, 2009, 11:47:05 AM12/22/09
to Diff Match Patch
I started a php-implementation but there are some fails.

http://tests.shwups.ch/diff_match_patch/

Would be great if someone can check it.

Tobi

unread,
Dec 27, 2009, 5:52:58 PM12/27/09
to Diff Match Patch

Tobi

unread,
Jan 12, 2010, 7:31:02 AM1/12/10
to Diff Match Patch
Updated!
http://tests.shwups.ch/diff_match_patch/

Still arrive 15 errors. (5.2.9 unix)
But on my local php-installations (5.2.4 win & 5.3 unix) only 9 errors
if i pass $patches to the function patch_addPadding as a reference:
function patch_addPadding(&$patches){...}

Maybe its useful to implement the native php-function levenshtein ??
http://php.net/manual/de/function.levenshtein.php

testDiffMain generates the error:
Fatal error: Allowed memory size of 134217728 bytes exhausted (tried
to allocate 1024 bytes) in C:\Users\NUXODIN\workspace\test\dmp
\diff_match_patch.php on line 413

Tobi

unread,
Feb 21, 2010, 11:31:08 AM2/21/10
to Diff Match Patch
Added to github:

http://github.com/nuxodin/diff_match_patch-php


On 12 Jan., 13:31, Tobi <tobias.busc...@gmail.com> wrote:
> Updated!http://tests.shwups.ch/diff_match_patch/


>
> Still arrive 15 errors. (5.2.9 unix)
> But on my local php-installations (5.2.4 win & 5.3 unix) only 9 errors
> if i pass $patches to the function patch_addPadding as a reference:
> function patch_addPadding(&$patches){...}
>

> Maybe its useful to implement the native php-function levenshtein ??http://php.net/manual/de/function.levenshtein.php

Jenolan

unread,
Mar 20, 2010, 5:34:39 AM3/20/10
to Diff Match Patch
Hi just tried your version but it sprayed quite a few errors in php
5.2.13

A snipped result

Notice: Uninitialized string offset: 0 in C:\inetpub\wwwroot\test
\diff_match_patch.php on line 797
Delta length (19) does not equal source text length (20).Ok
Delta length (19) does not equal source text length (18).Ok
Expected: '=7 -7 +%DA%82 %02 %5C %7C'
Actual: '=12 -12 +%5Cu0682 %5C %7C'
Warning: mb_strrpos() [function.mb-strrpos]: Offset is greater than
the length of haystack string in C:\inetpub\wwwroot\test
\diff_match_patch.php on line 1362
Invalid patch string: BadInvalid patch mode "P" in: atchOk
Warning: mb_strpos() [function.mb-strpos]: Empty delimiter in C:
\inetpub\wwwroot\test\diff_match_patch.php on line 1481

Any hints?

Thanks,
Larry

Reply all
Reply to author
Forward
0 new messages