title: Laravel Sail Docker - During inheritance of ArrayAccess
body: <p>Windows 11, Laravel v8.49.0, Docker with WSL 2 using Ubuntu-20.04. (Tried with PHP 7.4.x, 8.0.x and 8.1.x).</p>
  <p>Problem:</p>
  <pre><code>PHP Fatal error:  During inheritance of ArrayAccess: Uncaught ErrorException: Return type of Illuminate\Support\Collection::offsetExists($key) should either be compatible with Ar
  rayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/html/vendor/laravel/framework/src/Illuminate/C
  ollections/Collection.php:1459
  </code></pre>
  <p>Setup:</p>
  <ul>
  <li>Run <code>bash ./vendor/bin/sail up</code></li>
  <li>mysql gets started</li>
  <li>PHP fatal error shows up</li>
  <li>Docker retries, same output comes out</li>
  </ul>
  <p>I couldn't find related issues to be honest, and decided to post here. I've added <code>sail</code> into an existing project, and I cannot do a fresh install, as the project is beyond that stage.</p>
  <p>Complete stacktrace:</p>
  <pre><code>laravel.test_1  | Stack trace:
  laravel.test_1  | #0 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php(13): Illuminate\Foundation\Bootstrap\HandleExceptions-&gt;handleError()
  laravel.test_1  | #1 /var/www/html/vendor/composer/ClassLoader.php(478): include('...')
  laravel.test_1  | #2 /var/www/html/vendor/composer/ClassLoader.php(346): Composer\Autoload\includeFile()
  laravel.test_1  | #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/helpers.php(15): Composer\Autoload\ClassLoader-&gt;loadClass()
  
  laravel.test_1  | #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(89): collect()
  laravel.test_1  | #5 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/PackageManifest.php(78): Illuminate\Foundation\PackageManifest-&gt;config()
  laravel.test_1  | #6 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/RegisterFacades.php(26): Illuminate\Foundation\PackageManifest-&gt;aliases()
  laravel.test_1  | #7 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(237): Illuminate\Foundation\Bootstrap\RegisterFacades-&gt;bootstrap()
  laravel.test_1  | #8 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(310): Illuminate\Foundation\Application-&gt;bootstrapWith()
  laravel.test_1  | #9 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(127): Illuminate\Foundation\Console\Kernel-&gt;bootstrap()
  laravel.test_1  | #10 /var/www/html/artisan(37): Illuminate\Foundation\Console\Kernel-&gt;handle()
  laravel.test_1  | #11 {main} in /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/Collection.php on line 13
  laravel.test_1  | PHP Fatal error:  Uncaught Error: Class &quot;Illuminate\Support\Collection&quot; not found in /var/www/html/vendor/laravel/framework/src/Illuminate/Collections/helpers.php:15
  laravel.test_1  | Stack trace:
  laravel.test_1  | #0 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ReflectsClosures.php(24): collect()
  laravel.test_1  | #1 /var/www/html/vendor/laravel/framework/src/Illuminate/Support/Traits/ReflectsClosures.php(44): Illuminate\Foundation\Exceptions\ReportableHandler-&gt;closureParameterTypes()
  laravel.test_1  | #2 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/ReportableHandler.php(62): Illuminate\Foundation\Exceptions\ReportableHandler-&gt;firstClosureParamete
  rType()
  laravel.test_1  | #3 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Exceptions/Handler.php(234): Illuminate\Foundation\Exceptions\ReportableHandler-&gt;handles()
  laravel.test_1  | #4 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(88): Illuminate\Foundation\Exceptions\Handler-&gt;report()
  laravel.test_1  | #5 /var/www/html/vendor/laravel/framework/src/Illuminate/Foundation/Bootstrap/HandleExceptions.php(130): Illuminate\Foundation\Bootstrap\HandleExceptions-&gt;handleException()
  laravel.test_1  | #6 [internal function]: Illuminate\Foundation\Bootstrap\HandleExceptions-&gt;handleShutdown()
  laravel.test_1  | #7 {main}
  </code></pre>