Catch array_multisort warning
- materix
- Backer | 83
Sometimes I find the warning “Array sizes are inconsistent” in the logs, for the command “array_multisort()”.
This is my code:
$columns_1 = array_column($data, 'col1');
$columns_2 = array_column($data, 'col2');
$columns_3 = array_column($data, 'col3');
array_multisort($columns_1, SORT_ASC, $columns_2, SORT_ASC, $columns_3, SORT_ASC, $data);
The $data is fetched from an remote api.
I expect the reason for the error, is that the remote data sometimes is corrupted.
Is there any method to “catch” when there is a warning in
array_multisort
?