Count the number of ways to make a given sum using one number from each array
function get_sum ($dice, $sum) {
    ...
    echo count($sumcount);
}



Both the stated specification and the function name say that it will return the count, not print it.

Well, the function name get_XXX says it will return something. If you gave me the signature get_sum ($dice, $sum) and asked me to implement the body I would ask what $dice was for, since the signature clearly says that the body will be return $sum;. Surely there's a better name?




    $sumcount = array();
    ...
    echo count($sumcount);



That's a rather memory-inefficient way of counting something. Why not increment an integer counter instead of adding an array to an array?




                                $good_res = array();
                                array_push( $good_res, $die1, $die2, $die3, $die4, $die5);



Why not $good_res = array($die1, $die2, $die3, $die4, $die5)?




            if($num_of_dice == 5){
                foreach($dice[2] as $die3){
                    foreach($dice[3] as $die4){
                        foreach($dice[4] as $die5){
                            if($die1 + $die2 + $die3+ $die4 + $die5 == $sum){
                                $good_res = array();
                                array_push( $good_res, $die1, $die2, $die3, $die4, $die5);
                                array_push($sumcount, $good_res);
                            }
                        }
                    }
                }
            }



Again, the aim is to count. If $die1 + $die2 + $die3 + $die4 + $die5 == $sum, why does the loop over $die5 care what $die3 is? You could as well say

foreach ($dice[0] as $die1) {
    $counter += get_sum(array_slice($dice, 1), $sum - $die1);
}


You need to handle a couple of base cases, but that gives you code which should have fairly similar performance to the current code but is much much simpler. Then ask yourself how to memoise. Then ask yourself how to replace the recursion with iteration. The final result will be an iterative method which is about 10 lines long, handles any number of dice, and runs much faster than your current code.