The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

I have a function that requires as arguments a reference to an array and a reference to a scalar variable. This function passes those arguments to another function, which supplies them to a callback function when it gets executed at a later time, e.g., via call_user_func_args. In some cases, the callback may not require an array of arguments or return a value. Therefore, I want to provide an empty array and a null scalar as default arguments. My question is, is it legal to use a variable's name as a default argument in the function's declaration, as shown in this code?

How would you do it? Would it be best to leave those arguments out of the signature and use func_num_args and func_get_args in the function to decide whether anything has been passed? Or would this work?