In the following code, why does the callback function cast the $value argument as string?
$post_values = $_POST['dates'];
/*
var_dump of $post_values
array(1) { [0]=> array(3) { ["date"]=> string(10) "2016-05-10" ["starttime"]=> string(5) "12:30" ["endtime"]=> string(5) "14:33" } }
*/
$args = [
'dates' => [
'filter' => FILTER_CALLBACK,
'options' => function ($value) {
// The $value here has been cast to string. Why?
// $value now has value of: string(10) "2016-05-10".
// I expect it to be an array.
return $value;
}
]
];
$filtered_values = filter_var_array($post_values, $args);