title: register_shutdown_function returns "Invalid shutdown callback" error
body: <p>I'm trying to catch an error when maximum execution time limit exceeds and display a friendly notification about this, then redirect the user. This is my how my code looks like (This is a very shortened code):</p>
  <pre><code>class ProfitAndLossController extends Controller
  {
      private function shutdownFunction(){
          return response()-&gt;json(['error_message' =&gt; Lang::get('listings.file_too_large')], 403);
      }
  
      public function import(ImportListingRequest $request){
          $import = new ProfitAndLossImport();
          set_time_limit(30);
          register_shutdown_function($this-&gt;shutdownFunction());
          Excel::import($import, request()-&gt;file('pl'));
          return $import;
      }
  }
  </code></pre>
  <p>This immediately gives me an error: <code>&quot;register_shutdown_function(): Invalid shutdown callback '' passed&quot;</code></p>
  <p>If I try to <code>dump()</code> something from shutdown function, it dumps it immediately and gives the same error. I also tried to register it like this:</p>
  <pre><code>register_shutdown_function([$this, 'shutdownFunction']);
  </code></pre>
  <p>But it gives me an error: <code>&quot;Maximum execution time of 30 seconds exceeded&quot;</code>, but the function still does not get executed. What am I doing wrong?</p>