Petit problème PHP :)

Trouvez la solution à ce petit problème :

Ce bout de code :

<?php
$arr = array('A', 'B', 'C');
foreach ($arr as &$val) {}
foreach ($arr as $val) {}
var_dump($arr);
?>

Affiche :

array(3) {
     [0]=>  string(1) "A"
     [1]=>  string(1) "B"
     [2]=>  &string(1) "B"
}

Oui ! A, B, B !

POURQUOI ?

Read the rest of this post »

Filed under  //  Development   Php   foreach   probleme   scope   var  
Posted by Cyril Nicodème