Fatal error when calling drupal_goto from hook_boot-Collection of common programming errors

When I am trying to call drupal_goto from hook_boot I get an error:

Fatal error: Call to undefined function drupal_goto()

What am I doing wrong and why is that happening?

My code:

function custom_mobile_redirect_boot() {
  include_once 'Mobile_Detect.php';
  $detect = new Mobile_Detect();
  if ($detect->isMobile() || $detect->isTablet()) {
    drupal_goto('http://testsite.local');
  }
}