What are common pitfalls for beginners when trying to implement recursive numbering in PHP?

Common pitfalls for beginners when implementing recursive numbering in PHP include not properly defining the base case for the recursion, causing the function to run indefinitely, and not passing the necessary parameters correctly to the recursive function. To avoid these pitfalls, ensure that the base case is clearly defined to stop the recursion, and pass the required parameters accurately to the recursive function.

function recursiveNumbering($number) {
    if($number <= 0) {
        return; // base case to stop recursion
    }
    
    echo $number . " "; // output the current number
    
    recursiveNumbering($number - 1); // call the function recursively with updated number
}

recursiveNumbering(5); // Output: 5 4 3 2 1