protected function stringDiffersAt($first, $second)
    {
        if (! $first || ! $second) {
            return 0;
        }
        if (strlen($first) < strlen($second)) {
            list($first, $second) = array($second, $first);
        }
        $position = 0;
        $step     = strlen($first);
        while ($step > 1) {
            $step = (integer) (($step + 1) / 2);
            if (strncmp($first, $second, $position + $step) == 0) {
                $position += $step;
            }
        }

        return $position;
    }