From a9f124f81a9436138879e56157c6cced52a6d95b Mon Sep 17 00:00:00 2001 From: Heinz Wiesinger Date: Mon, 19 Mar 2018 09:25:38 +0100 Subject: [PATCH] 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. --- lib/Diff/SequenceMatcher.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/Diff/SequenceMatcher.php b/lib/Diff/SequenceMatcher.php index e819e810..a289e391 100644 --- a/lib/Diff/SequenceMatcher.php +++ b/lib/Diff/SequenceMatcher.php @@ -50,12 +50,12 @@ class Diff_SequenceMatcher /** * @var array The first sequence to compare against. */ - private $a = null; + private $a = array(); /** * @var array The second sequence. */ - private $b = null; + private $b = array(); /** * @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 */ public function __construct($a, $b, $junkCallback=null, $options) { - $this->a = null; - $this->b = null; + $this->a = array(); + $this->b = array(); $this->junkCallback = $junkCallback; $this->setOptions($options); $this->setSequences($a, $b); @@ -739,4 +739,4 @@ private function tupleSort($a, $b) return 1; } } -} \ No newline at end of file +}