[horde] php-4.4.0 woes

Chuck Hagenbuch chuck at horde.org
Mon Jul 18 11:45:31 PDT 2005


Quoting Joeri Pronk <joeri at joeri.nu>:

> As I understood it, you can only return references to a variable if you
> define it in the function (&) and you must return a named variable in
> the function itself. php 4.4.0 now sends out warnings when you do
> otherwise. for example:
>
> function &return_ref() {
> $var="some value waiting to be referenced";
> return $var;
> }
>
> $ref=return_ref(); // is ok

No, $ref is a copy and not a reference here.

> $ref=&return_ref(); // faulty?

This is correct usage.

> If this is still incorrect, please try to explain your point, or point
> me to an url?

http://www.php.net/manual/en/language.references.php

-chuck

-- 
"But she goes not abroad in search of monsters to destroy." - John 
Quincy Adams


More information about the horde mailing list