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());
    }