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

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

"Never doubt that a small group of thoughtful, committed people can
change the world...
Indeed, it's the only thing that ever has."

- Margaret Mead

--
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]

Reply via email to