[Xapian-devel] PHP Latest

Olly Betts olly at survex.com
Thu Apr 20 15:22:12 BST 2006


On Thu, Apr 20, 2006 at 03:05:57PM +0100, Sam Liddicott wrote:
> If we wanted
> 
> function blah($a,$b=getDefaultArg(), $c=$a+2) {
> 
> we can do
> 
> function blah($a,$b=NULL) {
>  if (func_get_arg_count()<2) $b=getDefaultArg();
>  if (func_get_arg_count()<3) $c=$a+2;
> 
> so for swig generated php we may be OK doing this.

Aha, that's a handy tip - func_get_arg_count() should be very efficient.
I'll investigate this.

Cheers,
    Olly



More information about the Xapian-devel mailing list