Get your own PHP server Result Size: 625 x 565
x
 
<!DOCTYPE html>
<html>
<body>
<pre>
<?php  
$cars = array("Volvo", "BMW", "Toyota");
foreach ($cars as &$x) {
  $x = "Ford";
}
unset($x);
var_dump($cars);
?>  
</pre>
</body>
</html>
array(3) {
  [0]=>
  string(4) "Ford"
  [1]=>
  string(4) "Ford"
  [2]=>
  string(4) "Ford"
}