Take a look to this code, and help me to understand the result
$x = array(\'hello\', \'beautiful\', \'world\'); $y = array(\'bye bye\',\'world\', \'harsh\');
After this loop is executed:
foreach ($x as $n => &$v) { }
$v ends up as a reference to $x[2]. Whatever you assign to $v actually gets assigned $x[2]. So at each iteration of the second loop:
$v
$x[2]
foreach ($y as $n => $v) { }
$v (or should I say $x[2]) becomes:
'bye bye'
'world'
'harsh'