[PHP] Variable number of arguments problem

2012-02-12 Thread Tim Streater
I have a function defined thus: function my_func ($arg1, $arg2, $arg3, $arg4, $arg5, $arg6) { // code here } I call this with variously the first three arguments only, or all six, taking care that if I call it with fewer arguments then I don't try to acces $arg4, $arg5, or

Re: [PHP] Variable number of arguments problem

2012-02-12 Thread Stuart Dallas
On 12 Feb 2012, at 18:51, Tim Streater wrote: I have a function defined thus: function my_func ($arg1, $arg2, $arg3, $arg4, $arg5, $arg6) { // code here } I call this with variously the first three arguments only, or all six, taking care that if I call it with fewer

Re: Re: [PHP] Variable number of arguments problem

2012-02-12 Thread Tim Streater
On 12 Feb 2012 at 19:01, Stuart Dallas stu...@3ft9.com wrote: Optional arguments must be given a default value... function my_func($arg1, $arg2, $arg3, $arg4 = null, $arg5 = null, $arg6 = null) Note that passing a default value by reference was not supported prior to PHP5. All the