title: $env must not be accessed before initialization
body: <p>I upgrade my project from SF 5.4 to SF 6 with php 8.1.2.</p>
  <p>With my dev env I have no errors!</p>
  <p>When I use the prod env when I cache clear I have the error:</p>
  <pre><code>In Route.php line 196:
                                                                                                                
    Typed property Symfony\Component\Routing\Annotation\Route::$env must not be accessed before initialization  
  </code></pre>
  <p>I try to remove the var/cache folder.</p>
  <p>Do you have any ideas how to fix that one?</p>
  <p>I found the same error in stack and I replace the handler_id with null value.</p>
  <p>The error come from the SF router vendor. Route.php is not my own code.</p>