I am a n00b at php. I was learning about Default Parameters so I made this function.
function doFoo($name = "johnny"){
echo "Hello $name" . "<br />";
}
I made these calls
doFoo();
doFoo("ted");
doFoo("ted", 22);
The first two printed what was expected i.e
Hello johnny
Hello ted
but the third call also printed
Hello ted
I was expecting an error, after all the function is made for one argument whereas I am calling it with two arguments.
Why was there no error?