Re: [PHP4BETA] Varargs user function?

From: Date: Mon, 20 Sep 1999 12:01:41 +0000
Subject: Re: [PHP4BETA] Varargs user function?
References: 1  Groups: php.version4 
Request: Send a blank email to php-version4+get-4662@lists.php.net to get a copy of this message
Zeev Suraski wrote: > > How do I write a varargs user function in Zend/PHP4? > > > > In PHP3, I have the choice to cap the maximal number of parameters and use > > default arguments, or to pass an array to the function. Has this changed/improved > > in Zend/PHP4? > > No, it hasn't. The syntax is identical. I suppose there is no way that we get a more elegant way to write varargs functions in Zend/PHP4? Perhaps by declaring them in a special way function blah(varargs $a) { /* access $a as an array */ } /* Call them as a function with a variable number of * args that is automatically transformed into an * array within the function? * */ blah($c, $d, 1, 2, 3); blah($x, $z, $q); or by some other kind of magic? -- Kristian Köhntopp, NetUSE Kommunikationstechnologie GmbH Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00 Using PHP3? See our web development library at http://phplib.netuse.de/ (We have moved! Update your bookmarks!)

« previous php.version4 (#4662) next »