diff -u b/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php b/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php --- b/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php +++ b/core/lib/Drupal/Core/EventSubscriber/HttpExceptionSubscriberBase.php @@ -100,7 +100,7 @@ $method = 'on' . $exception->getStatusCode(); // Keep just the leading number of the status code to produce either a // on400 or a 500 method callback. - $method_fallback = 'on' . floor($exception->getStatusCode() / 100) . 'xx'; + $method_fallback = 'on' . strval($exception->getStatusCode())[0] . 'xx'; // We want to allow the method to be called and still not set a response // if it has additional filtering logic to determine when it will apply. // It is therefore the method's responsibility to set the response on the