Hi,
I need to write a function that has conditional default values. For example:
function myFunction($arg1, $arg2=false, $arg3 ??)
If possible, I need to make $arg3 REQUIRED if and only IF $arg2=true.
Then this particular function would only be able to be called with 1 or 3 arguments, but not 2. For example, I could call it thusly:
myFunction(35); //only uses first argument
myFunction(35, true, 'G'); //uses all
//the following would be illegal:
myFunction(35, true);
I suppose the function signature would look like this:
myFunction( int $arg1 [, boolean $arg2, string $arg3] )
Does this make sense? Thanks for any help.