I've got a function, it just so happens its a constructor but that's besides the point. Its got 4 arguments and I want to die if the an incorrect number of arguments are supplied to it. At the moment I'm doing something like this:
Code: Select all
define('FOO_REQUIRED_ARGS',4);
function foo($arg1,$arg2,$arg3,$arg4) {
$num_args = func_num_args();
if ($num_args != FOO_REQUIRED_ARGS) die('bad call');
}any php geniuses out there with a solution to this very very small problem? or is this just a language immaturity issue.
oLE