I was running a laravel server using php artisan serve --host <my-public-ip> --port 80
when suddenly my server crashed with this error:
Undefined array key 60196
at D:\Code\schedule\bfcai-schedule\vendor\laravel\framework\src\Illuminate\Foundation\Console\ServeCommand.php:263
259▕
260▕ $this->requestsPool[$requestPort][1] = trim(explode('[200]: GET', $line)[1]);
261▕ } elseif (str($line)->contains(' Closing')) {
262▕ $requestPort = $this->getRequestPortFromLine($line);
➜ 263▕ $request = $this->requestsPool[$requestPort];
264▕
265▕ [$startDate, $file] = $request;
266▕
267▕ $formattedStartedAt = $startDate->format('Y-m-d H:i:s');
1 D:\Code\schedule\bfcai-schedule\vendor\laravel\framework\src\Illuminate\Foundation\Console\ServeCommand.php:263
Illuminate\Foundation\Bootstrap\HandleExceptions::Illuminate\Foundation\Bootstrap\{closure}("Undefined array key 60196", "D:\Code\schedule\bfcai-schedule\vendor\laravel\framework\src\Illuminate\Foundation\Console\ServeCommand.php")
2 D:\Code\schedule\bfcai-schedule\vendor\laravel\framework\src\Illuminate\Collections\Traits\EnumeratesValues.php:236
Illuminate\Foundation\Console\ServeCommand::Illuminate\Foundation\Console\{closure}("[Sat Feb 18 12:51:14 2023] 25.66.139.15:60196 Closing")
What may have caused this issue and what preventative measures can be taken to avoid its recurrence?