<?php
$first = [
'c' => 'd',
'm' => 'n',
];
$second = [
'C' => 'd', // first encounter, qualifying key, qualifying value (['c' => 'd'] is removed from result)
'c' => 'D', // doesn't matter
'm' => 'N', // first encounter, qualifying key, disqualifying value
'M' => 'n', // this should eliminate ['m' => 'n'], but doesn't get the chance
];
/* behavior discovered while crafting this answer:
* https://stackoverflow.com/a/70817582/2943403
*/
var_export(
array_diff_uassoc(
$first,
$second,
'strcasecmp'
)
); // removes first-occurring, case-insensitive key, case-sensitive value
preferences:
16.1 ms | 402 KiB | 5 Q