Re: consistent way to handle structs

From: Date: Fri, 11 Jan 2002 11:51:37 +0000
Subject: Re: consistent way to handle structs
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-76619@lists.php.net to get a copy of this message
On Fri, 11 Jan 2002, Markus Fischer wrote: > What other way do we have to specify arbitray optional > parameters without an ordering? Teh disadvantage of optional > parmeters is when you need to only set the last one, you'll > have to define all preceding optional parameters too. How does the MySQL C API handle this? I think using array() is pretty sucky. Look at the following example and I'm sure you're planning on it getting much worse. mysql_connect("foo", array("bar" => 1, "hello" => 2)); > > For functions like mysql_connect() the performance impact is > negligible (methinks). I don't think it'll always be negligible. It might not always be a bad idea but I think that if we support this easy to use function we're going to see this kind of stuff pop-up in more places than the very few places which just can't do without. Andi

« previous php.dev (#76619) next »