I think that those two array_key_exists calls can be replaced with isset($tabs[$tabIndex]['name'])