`array_diff_key()` gives you all the items of `$types` whose key does not exist as a key in `$mapping['extensions']`...  Therefore, the condition will never not be true...

```
$a = array(
  'a' => 'alpha',
  'b' => 'bravo',
  'c' => 'charlie',
);
$b = array(
  'b' => 'banana',
  'c' => 'cherry',
  'd' => 'durian',
);
$c = array_diff_key($a, $b);
// $c is array('a' => 'alpha'), because the something exists with the keys 'b' and 'c' in the second array, and nothing
// with 'd' matches in the first.
```