I came from C++ / java background. I have been programming in PHP for a few months, but just today, after prolonged debugging, just realized php compiler doesn’t check for # of arguments passed vs. defined!
E.G.
[php]
function test($only_one, $no_use) {
print $only_one;
}
test(‘aa’, 5, 3);
[/php]
prints ‘aa’ … with arguments 5 and 3 ignored!
Problem is that I’ve been refactoring my code without IDE, and now I am not so confident about the result since I had assumed compiler would catch all cases where the arguments I pass in do not match the function definition.
What’s the best way to check my code to ensure number of arguments passed = arguments defined for all my functions?