For the record, I have no idea how the 4.3 -> 4.4 change could trigger
such a bug.  I just pointed out that we've hit the symptom Colin
described many times in our company with code (yes, bad code) of 
the form:

<?php
function &f(&$y) { return $y; }
$x = array('a','b','c');
foreach ($x as $y) {
   // The following line is a bad use of "&".  It doesn't
   // do any good and ends up causing all the members of $z
   // to be references to eachother.
   $z[] =& f($y);
}
var_dump($x);
var_dump($z);
?>

I've played with many flavors of this user-bug, adding and
subtracting "&"s, but have been unable to get different 
behavior between 4.3 and 4.4.  Colin, when you find the code
that went wild in the switch to 4.4, please post it.  I'm
sure there are others that are as curious as I am.  (There
may even be someone nice enough to fix the BC break if
it doesn't mean reintroducing memory corruptions.)

As long as I'm posting, I might as well put in a "thank you"
note for the notices.  I know they're generating a lot of
heat, but it's made it soooo much easier to fix all of the
novice uses of "&"s in our code.

Thanks,
Todd

> ...  I may not have provided any code, but this problem description was 
> enough for Todd Ruth to send me a very helpful and informative e-mail on 
> the matter (i.e. "everything the same as the last added" bugs), which 
> shall help me greatly in tracking it down (thanks again, Todd!).
> 
> Regards,
> 
> Colin.
> 

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to