public static function solve(array $sudoku, $checkInput = false)
    {
        if($checkInput && !self::checkInput($sudoku))
        {
            throw new \InvalidArgumentException('The input is no valid Sudoku array.');
        }

        return self::recursive_solve($sudoku, count($sudoku));
    }
public static function solve(array $sudoku, $checkInput = false)
    {
        if($checkInput && !self::checkInput($sudoku))
        {
            throw new \InvalidArgumentException('The input is no valid Sudoku array.');
        }

        return self::recursive_solve($sudoku, count($sudoku));
    }
public static function solve ( array $ sudoku , $ checkInput = false ) { if ( $ checkInput && ! self :: checkInput ( $ sudoku ) ) { throw new \ InvalidArgumentException ( 'The input is no valid Sudoku array.' ) ; } return self :: recursive_solve ( $ sudoku , count ( $ sudoku ) ) ; }
Solves the Sudoku.

@param array $sudoku
@param bool  $checkInput If true, the input gets checked for a valid Sudoku array, i.e.
if it's a two dimensional square array containing only int and
null values
@return array|false      Returns the solution or false if the sudoku is not solvable.
@throws \InvalidArgumentException
Solves the Sudoku .