[horde] php-4.4.0 woes

Joeri Pronk joeri at joeri.nu
Mon Jul 18 11:41:02 PDT 2005


> Unfortunately this is very, very wrong. Folks, DO NOT go around
> modifying your code in this way; it _will_ break things.

I am sorry to cause any confusion, surely not my intent.
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
$ref=&return_ref(); // faulty?

This is what I meant, I know I left out some very important information 
about the function must be defined with an & in front for my solution 
to work, my mistake.
If this is still incorrect, please try to explain your point, or point 
me to an url?

>
> Joeri, please be careful about making statements like this. This simply
> isn't how references work in php4.

I understand that you cannot remove the & by rule and get automatically 
correct code, however from what I have found in all Horde code that the 
defines were already correct (using the & when it should return a 
reference). Ofcourse this was a (lazy) assumption I did. I hope I wont 
start a flame, I just want to know what I did wrong (besides leaving 
out important information about defining the function returning a 
reference in the first place)

>
>> I wonder if anybody on the horde project is already looking into
>> this, or should I post a bug report on this?
>
> There are already 3-4 duplicate bug reports. Feel free to add notices
> that aren't already fixed, but please make COMPLETELY sure you're using
> the very latest CVS to test and that you're not duplicating existing
> reports.
Ok, duly noted.

>
> -chuck

Cheers,

Joeri




More information about the horde mailing list