Re: Re: Named arguments revisited

From: Date: Sun, 15 Jan 2006 23:29:50 +0000
Subject: Re: Re: Named arguments revisited
References: 1 2 3 4 5 6 7 8 9 10 11 12  Groups: php.internals 
Request: Send a blank email to internals+get-21553@lists.php.net to get a copy of this message
Bart de Boer wrote:
Stefan Walk wrote:
Just a small suggestion - what do you all think of creating an array implicitely on function calls like db_connect('host' => $host, 'port' =>$port), or funcname($param1, $param2, 'foo' => 'bar'). Those parts would have to be on the very end of the argument list. Would eliminate the need for "a bit more to type". function definition would be like function funcname ($p1, $p2, $params = array());
I don't like the array. However, I do like the way you're specifying the parameter with 'host' and 'port'. Perhaps something like: mysqli_connect('host' = $host, 'port' = $port); :) Bart
Argh, that was a bad idea. This would mean we could also do: mysqli_connect($host = $myhost, $port = $myport); Which currently already is legal syntax.

« previous php.internals (#21553) next »