Where do I make a formal request for a feature? In Perl or Ruby, I
could have said:
foo ({ 'var1' => 'value', 'var2' => 'value'});
and it is so much more elegant than having to say:
$hash = array (
'var1' => 'value',
'var2' => 'value'
);
foo ($hash);
elegance is everything, man.
lux
Christian Reiniger wrote:
> On Sunday 04 February 2001 07:31, John Luxford wrote:
>
>
>
>
>> function foo (&$hash) {
>
>> while (list ($k, $v) = each ($hash)) {
>
>> echo "$k :: $v<br />\n";
>
>> }
>
>> }
>
>
>
>> // but what I want to say is something like this
>
>>
>
>> foo (["one" => "value", "two" => "value"]);
>
>
>
> foo () is declared to take a reference to a variable. This only works
>
> with "real" variables, not the temporary ones returned from array() etc.
>
> Modify it to
>
> function foo ($hash) {
>
>
>
> and it will work
--
John Luxford
Simian Systems
w: www.simian.ca
e: [EMAIL PROTECTED]
p: 204.946.5955
--
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]