We have an array of strings of numbers
$a = ["1", "2", "3"];
foreach loop doesn't change the type, result: [0]=>string(1) "1"
foreach ($a as $v) $v = (int) $v;
for loop makes ints from strings, result: [0]=>int(1)
for ($i = 0; $i < count($a); $i++) $a[$i] = (int) $a[$i];
Please, explain why is that?