Skip to content

Commit bced891

Browse files
committed
Fix warning with PHP 7.2 when trying to count NULL.
Initializing the variables to an empty array avoids the warning and yields the same behavior.
1 parent cb466a6 commit bced891

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

library/vendor/php-diff/lib/Diff/SequenceMatcher.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ class Diff_SequenceMatcher
5050
/**
5151
* @var array The first sequence to compare against.
5252
*/
53-
private $a = null;
53+
private $a = array();
5454

5555
/**
5656
* @var array The second sequence.
5757
*/
58-
private $b = null;
58+
private $b = array();
5959

6060
/**
6161
* @var array Array of characters that are considered junk from the second sequence. Characters are the array key.
@@ -86,8 +86,8 @@ class Diff_SequenceMatcher
8686
*/
8787
public function __construct($a, $b, $junkCallback=null, $options)
8888
{
89-
$this->a = null;
90-
$this->b = null;
89+
$this->a = array();
90+
$this->b = array();
9191
$this->junkCallback = $junkCallback;
9292
$this->setOptions($options);
9393
$this->setSequences($a, $b);
@@ -739,4 +739,4 @@ private function tupleSort($a, $b)
739739
return 1;
740740
}
741741
}
742-
}
742+
}

0 commit comments

Comments
 (0)