Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zlem0815's avatar

Max call stack size reached. Infinite recursion, Laravel 11, PHP 8.3

Hi,

just executded the regular "composer up" command on Laravel 11, PHP 8.3 and now facing:

Maximum call stack size of 8339456 bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion?

  at vendor/laravel/framework/src/Illuminate/Container/Container.php:1570
    1566▕      * @return mixed
    1567▕      */
    1568▕     public function offsetGet($key): mixed
    1569▕     {
  ➜ 1570▕         return $this->make($key);
    1571▕     }
    1572▕
    1573▕     /**
    1574▕      * Set the value at a given offset.

      +22 vendor frames

  23  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()
      +5 vendor frames

  29  artisan:35
      Illuminate\Foundation\Console\Kernel::handle()

Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

Already tried in php.ini with "zend.max_allowed_stack_size=-1" but no success

I have no clue what the cause is. I would be grateful for any hint - thank you!

1 like
3 replies
Snapey's avatar
Snapey
Best Answer
Level 122

I would start with deleting the vendor folder and clear composer cache.

If it is still an issue, you are going to have to try upgrading individual packages until it fails.

zlem0815's avatar

@Snapey Thank you so much for your prompt reply!

Deletion of vendor did not help, but upgrading individual packages did help

cause is  "laravel-lang/routes": "^1.0"
required by "laravel-lang/common": "^6.0",

there is already a ticket for it: github.com/Laravel-Lang/common/issues/198

After removal of those two, it worked without any problems

1 like
PhillipMwaniki's avatar

I do have a similar issue on Laravel 11 with PHP 8.3 being caused by Sanctum. I've applied these fixes on on my php.ini file

zend.max_allowed_stack_size = -1 zend.reserved_stack_size = -1

And I've also re-installed valet and and my vendor folder. Is there a known fix for this?

Please or to participate in this conversation.