PHP has some idiosyncrasies that can cause odd or counter intuitive behavior. This will be a series of short posts covering some of these situations.
Let’s have a look at the following simple piece of code:
$arr = array('foo','bar','baz');
foreach($arr as &$item){
echo "First array: ".$item …