Well, you could change findClickedButton to return false for example. Its just internal. And isset has shown to be faster than array_key_exists.