in_array really loves typecast

<?php
$a
= array('7.1');
var_dump(in_array('7.10', $a));
?>

bool(true)
I have no explanation. Both are strings. Really: WTF?

Note that the reason is not really in_array but var_dump("7.1"=="7.10"); this being TRUE. Which is again quite unexpected: why does PHP cast strings to floats? It is float:

<?php
$a
= '7.1';
$b = '7.1' str_repeat('0', 14) . '1';
print
"$a\n$b\n";
var_dump($a==$b);
$b = '7.1' str_repeat('0', 15) . '1';
print
"$b\n";
var_dump($a==$b);
?>