Get help on this challenge

Debugging19


Please read this explanation before attempting debugging challenges.


My annoying colleague modified my code yesterday and now I get this weird error when I try to run it: PHP Parse error: syntax error, unexpected '}' in debugging19.php on line 11

<?php
function arrayDiffRecursive(array $array1, array $array2) {
    $return = array();

    foreach ($array1 as $key => $value) {
        if (array_key_exists($key, $array2)) {
            if (is_array($value)) {
                $recursiveDiff = self::arrayDiffRecursive($value, $array2[$key]);
                if (count($recursiveDiff)) {
                    $return[$key] = $recursiveDiff;
                }
            } else {
                if ($value != $array2[$key]) {
                    $return[$key] = $value;
                }
            }
        } else {
            $return[$key] = $value;
        }
    }

    return $return;
}

$diff = arrayDiffRecursive(array("a"), array("b"));
?>

Downloadable source code can be found here.


You must be logged in to play.



Challenge by ynori7.