Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
As per function drupal_goto()
This function ends the request; use it instead of a return in your menu callback.
It's confusing that there are many cases where drupal_goto() is called in this module and afterwards you have exit; return;, this kind of stuff. Anything after drupal_goto() will never run since drupal_exit() is called on the last line of the function.