You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There's an issue in DiffToolkit where it's calling mb_strlen(mb_strlen($longtext)) this produces an error on newer php versions (using declare(strict_types=1)) because mb_strlen must receive a string as an argument.
fede@desktop ~/Codes/diff-match-patch ~ $ vendor/phpunit/phpunit/phpunit
//PHPUnit 9.1.3 by Sebastian Bergmann and contributors.
Runtime: PHP 7.4.5
Configuration: /home/fede/Codes/diff-match-patch/phpunit.xml.dist
.E.......EEE..........E.............EEEE.Elapsed time: 0.008
Memory usage: 0.144
.Elapsed time: 0.158
Memory usage: 0
.. 44 / 44 (100%)
Time: 00:00.315, Memory: 8.00 MB
There were 9 errors:
1) DiffMatchPatch\DiffMatchPatchTest::testDiffMain
TypeError: Argument 4 passed to DiffMatchPatch\Diff::compute() must be of the type int, float given, called in /home/fede/Codes/diff-match-patch/src/Diff.php on line 991
/home/fede/Codes/diff-match-patch/src/Diff.php:1029
/home/fede/Codes/diff-match-patch/src/Diff.php:991
/home/fede/Codes/diff-match-patch/src/DiffMatchPatch.php:174
/home/fede/Codes/diff-match-patch/tests/DiffMatchPatchTest.php:79
2) DiffMatchPatch\DiffMatchPatchTest::testPatchMake
TypeError: Argument 4 passed to DiffMatchPatch\Diff::compute() must be of the type int, float given, called in /home/fede/Codes/diff-match-patch/src/Diff.php on line 991
/home/fede/Codes/diff-match-patch/src/Diff.php:1029
/home/fede/Codes/diff-match-patch/src/Diff.php:991
/home/fede/Codes/diff-match-patch/src/Patch.php:293
/home/fede/Codes/diff-match-patch/src/DiffMatchPatch.php:262
/home/fede/Codes/diff-match-patch/tests/DiffMatchPatchTest.php:164
3) DiffMatchPatch\DiffMatchPatchTest::testPatchApply
TypeError: Argument 4 passed to DiffMatchPatch\Diff::compute() must be of the type int, float given, called in /home/fede/Codes/diff-match-patch/src/Diff.php on line 991
/home/fede/Codes/diff-match-patch/src/Diff.php:1029
/home/fede/Codes/diff-match-patch/src/Diff.php:991
/home/fede/Codes/diff-match-patch/src/Patch.php:293
/home/fede/Codes/diff-match-patch/src/DiffMatchPatch.php:262
/home/fede/Codes/diff-match-patch/tests/DiffMatchPatchTest.php:176
/home/fede/Codes/diff-match-patch/tests/DiffMatchPatchTest.php:188
4) DiffMatchPatch\DiffMatchPatchTest::testPatchApply_2
TypeError: Argument 4 passed to DiffMatchPatch\Diff::compute() must be of the type int, float given, called in /home/fede/Codes/diff-match-patch/src/Diff.php on line 991
/home/fede/Codes/diff-match-patch/src/Diff.php:1029
/home/fede/Codes/diff-match-patch/src/Diff.php:991
/home/fede/Codes/diff-match-patch/src/Patch.php:293
/home/fede/Codes/diff-match-patch/src/DiffMatchPatch.php:262
/home/fede/Codes/diff-match-patch/tests/DiffMatchPatchTest.php:176
/home/fede/Codes/diff-match-patch/tests/DiffMatchPatchTest.php:196
5) DiffMatchPatch\DiffTest::testMain
TypeError: Argument 4 passed to DiffMatchPatch\Diff::compute() must be of the type int, float given, called in /home/fede/Codes/diff-match-patch/src/Diff.php on line 991
/home/fede/Codes/diff-match-patch/src/Diff.php:1029
/home/fede/Codes/diff-match-patch/src/Diff.php:991
/home/fede/Codes/diff-match-patch/tests/DiffTest.php:729
6) DiffMatchPatch\PatchTest::testMake
TypeError: Argument 4 passed to DiffMatchPatch\Diff::compute() must be of the type int, float given, called in /home/fede/Codes/diff-match-patch/src/Diff.php on line 991
/home/fede/Codes/diff-match-patch/src/Diff.php:1029
/home/fede/Codes/diff-match-patch/src/Diff.php:991
/home/fede/Codes/diff-match-patch/src/Patch.php:293
/home/fede/Codes/diff-match-patch/tests/PatchTest.php:157
7) DiffMatchPatch\PatchTest::testSplitMax
TypeError: Argument 4 passed to DiffMatchPatch\Diff::compute() must be of the type int, float given, called in /home/fede/Codes/diff-match-patch/src/Diff.php on line 991
/home/fede/Codes/diff-match-patch/src/Diff.php:1029
/home/fede/Codes/diff-match-patch/src/Diff.php:991
/home/fede/Codes/diff-match-patch/src/Patch.php:293
/home/fede/Codes/diff-match-patch/tests/PatchTest.php:214
8) DiffMatchPatch\PatchTest::testAddPadding
TypeError: Argument 4 passed to DiffMatchPatch\Diff::compute() must be of the type int, float given, called in /home/fede/Codes/diff-match-patch/src/Diff.php on line 991
/home/fede/Codes/diff-match-patch/src/Diff.php:1029
/home/fede/Codes/diff-match-patch/src/Diff.php:991
/home/fede/Codes/diff-match-patch/src/Patch.php:293
/home/fede/Codes/diff-match-patch/tests/PatchTest.php:247
9) DiffMatchPatch\PatchTest::testApply
TypeError: Argument 4 passed to DiffMatchPatch\Diff::compute() must be of the type int, float given, called in /home/fede/Codes/diff-match-patch/src/Diff.php on line 991
/home/fede/Codes/diff-match-patch/src/Diff.php:1029
/home/fede/Codes/diff-match-patch/src/Diff.php:991
/home/fede/Codes/diff-match-patch/src/Patch.php:293
/home/fede/Codes/diff-match-patch/tests/PatchTest.php:288
Regards!
The text was updated successfully, but these errors were encountered:
Hi there!
There's an issue in
DiffToolkit
where it's callingmb_strlen(mb_strlen($longtext))
this produces an error on newer php versions (usingdeclare(strict_types=1)
) becausemb_strlen
must receive a string as an argument.After changing it all tests keep passing
diff-match-patch/src/DiffToolkit.php
Line 175 in 463b635
Here's the previous phpunit log
PhpUnit Log
Regards!
The text was updated successfully, but these errors were encountered: