My validate function looks like that
function validate($data, $data2 = 0, $type) { ...
Function call example
if ($result =
Missing argument 3 ($type) for validate()
Always list optional arguments as the last arguments. Since PHP doesn't have named parameters nor "overloading ala Java", that's the only way:
function validate($data, $type, $data2 = 0) { }