I have a PHP function signature that looks like this, where I want the 4th param to be NULL by default if nothing is supplied.
testfunction($param1, $param2, $param3, $param4=NULL) {
//do stuff
}
I can also call using 4 params as such
x = testfunction('100', 'abc', 'xxx', null);
Why is it that I can also call the function using 3 parameters without any errors?
x = testfunction('100', 'abc', 'xxx');
Is what i'm doing even correct (using 3 params)? Any thoughts about how this relates to traditional method overloading where separate function signatures are defined?
My question is general in nature. Hope someone can shed some light on and around it.