protected function bisectSplit($text1, $text2, $x, $y, $deadline)
    {
        $text1A = mb_substr($text1, 0, $x);
        $text2A = mb_substr($text2, 0, $y);
        $text1B = mb_substr($text1, $x);
        $text2B = mb_substr($text2, $y);

        // Compute both diffs serially.
        $diffA = new Diff();
        $diffA->main($text1A, $text2A, false, $deadline);
        $diffB = new Diff();
        $diffB->main($text1B, $text2B, false, $deadline);

        return array_merge($diffA->getChanges(), $diffB->getChanges());
    }
protected function bisectSplit($text1, $text2, $x, $y, $deadline)
    {
        $text1A = mb_substr($text1, 0, $x);
        $text2A = mb_substr($text2, 0, $y);
        $text1B = mb_substr($text1, $x);
        $text2B = mb_substr($text2, $y);

        // Compute both diffs serially.
        $diffA = new Diff();
        $diffA->main($text1A, $text2A, false, $deadline);
        $diffB = new Diff();
        $diffB->main($text1B, $text2B, false, $deadline);

        return array_merge($diffA->getChanges(), $diffB->getChanges());
    }
protected function bisectSplit ( $ text1 , $ text2 , $ x , $ y , $ deadline ) { $ text1A = mb_substr ( $ text1 , 0 , $ x ) ; $ text2A = mb_substr ( $ text2 , 0 , $ y ) ; $ text1B = mb_substr ( $ text1 , $ x ) ; $ text2B = mb_substr ( $ text2 , $ y ) ; // Compute both diffs serially. $ diffA = new Diff ( ) ; $ diffA -> main ( $ text1A , $ text2A , false , $ deadline ) ; $ diffB = new Diff ( ) ; $ diffB -> main ( $ text1B , $ text2B , false , $ deadline ) ; return array_merge ( $ diffA -> getChanges ( ) , $ diffB -> getChanges ( ) ) ; }
Given the location of the 'middle snake', split the diff in two parts and recurse.

@param string $text1    Old string to be diffed.
@param string $text2    New string to be diffed.
@param int    $x        Index of split point in text1.
@param int    $y        Index of split point in text2.
@param int    $deadline Time at which to bail if not yet complete.

@return array Array of diff arrays.
Given the location of the middle snake split the diff in two parts and recurse .