On Sunday 04 February 2001 20:09, Lux wrote:

> > Now, let me tell you that somehow I agreed with you :) cause I love
> > Python way
> > of dealing with arrays, but we are in PHP, so we have to figure PHP
> > way,

> Let's make PHP our favourite language!  If another has a better
> feature, take it.

But the feature is useless :)

Let me elaborate:

You declared your function as
 function foo (&$hash)

That is you take a reference to that parameter ($hash). That's only 
useful if you want to modify that parameter in such a way that the caller 
also notices that modification.
Now if you pass an anonymous array to the function, you could modify 
that, but after your function exits that array is automatically 
destroyed, before the caller can do anything with it.

So if you don't have a good reason to use a reference in that place (I 
very much assume you don't), use normal pass-by-value. In PHP4 that's 
just as fast as pass-by-reference (read 
http://www.zend.com/zend/art/ref-count.php)


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

The most exciting phrase to hear in science, the one that heralds new
discoveries, is not "Eureka", but "That's funny..."

- Isaac Asimov

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