It's even faster like this:
``` php
if (!empty($directChildren) && count($diff = array_diff_key($directChildren, $this->bundles))) {
    $diff = array_keys($diff);
    throw new \LogicException(sprintf('Bundle "%s" extends bundle "%s", which is not registered.', $directChildren[$diff[0]], $diff[0]));
}
```