If you do not specify default values ββfor the arguments, you must pass the values ββwhen calling the function:
function load($name, $arg1, $arg2, $arg3, $arg4){ load('x');
but with default settings:
function load($name, $arg1, $arg2 = null, $arg3 = null, $arg4 = null){ load('x', 'y');
There are other options - pass parameter arguments in an array or use func_get_arg()
function load($name) { load('x', 'y', 'z') // not an error, use func_get_args/func_num_args to get the extras
source share