How can the PHP function provided be tested to ensure its functionality?

Issue: The PHP function needs to be tested to ensure its functionality and correctness. To test the PHP function, you can create a series of test cases that cover different scenarios and edge cases. This can include providing valid input values, invalid input values, and edge cases where the function may behave differently. You can then run these test cases and compare the expected output with the actual output to verify the correctness of the function.

// Sample PHP function to be tested
function add($num1, $num2) {
    return $num1 + $num2;
}

// Test cases
echo add(2, 3); // Expected output: 5
echo add(-2, 3); // Expected output: 1
echo add(0, 0); // Expected output: 0
echo add(10, -5); // Expected output: 5