Documentation doesn't state anything about returning option values of corresponding type. In fact, they should be strings in common case. (But, if you want, you can check this implementation). Instead you can apply simple callback, for example, via array_walk_recursive()
:
$array = ["arr"=>["0", "1", "2"], "integer_value"=>"3", "float_value"=>"-0.5"];
array_walk_recursive($array, function(&$value, $key)
{
if(is_numeric($value))
{
$value = (string)((int)$value)===$value
?(int)$value
:(double)$value;
}
});
-check this fiddle.