Skip to content

Commit 863df96

Browse files
1 parent 9db9ff8 commit 863df96

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

src/Differ.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ public function __construct($header = "--- Original\n+++ New\n")
4949
*/
5050
public function diff($from, $to, LongestCommonSubsequence $lcs = null)
5151
{
52+
if (!is_array($from) && !is_string($from)) {
53+
$from = (string) $from;
54+
}
55+
56+
if (!is_array($to) && !is_string($to)) {
57+
$to = (string) $to;
58+
}
59+
5260
$buffer = $this->header;
5361
$diff = $this->diffToArray($from, $to, $lcs);
5462

tests/DifferTest.php

211 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)