Re: Named arguments

From: Date: Mon, 14 Apr 2003 04:04:21 +0000
Subject: Re: Named arguments
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-143709@lists.php.net to get a copy of this message
You can just pass an associative array, every entry is named by a key :] Cheers, Rob. Sparky Kopetzky wrote: > > Gotta question for all of the gurus... > > I know you can have default values in a function. Is there anyway you can use 'named > arguments' like Visual Basic?? > > I've got a large number of functions that I need to call is this manner. The use of > 'NULL' 40,000 times is a major pain in the posterior to fill all of the missing arguments. > If the writers of PHP could add a ability like this, they would be right up there with Twinkies, > Yoo-Hoo's and God: > > function _browser($html_version = false, $explorer_version = false, $navigator_version = false) > { > blah-blah-blah; > } > > $value = _browser($navigator_version := true); > > Just hoping someone could add this feature to save grief and ulcers... > > Robin Kopetzky > Black Mesa Computers/Internet Services -- .---------------------------------------------. | Worlds of Carnage - http://www.wocmud.org | :---------------------------------------------: | Come visit a world of myth and legend where | | fantastical creatures come to life and the | | stuff of nightmares grasp for your soul. | `---------------------------------------------'

« previous php.general (#143709) next »