Skip to content

Cache::many with MemcachedStore throws exception because of array_combine #35324

Closed
@WarcraftLogs

Description

@WarcraftLogs
  • Laravel Version: 8.15.0
  • PHP Version: 7.4.11

Description:

When invoking Cache::many() with an array of keys where only a subset of the keys are hits, an exception is occurring because of an element count mismatch using array_combine.

ErrorException: array_combine(): Both parameters should have an equal number of elements
#75 /vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php(92): Illuminate\Foundation\Bootstrap\HandleExceptions::handleError
#74 internal: array_combine
#73 /vendor/laravel/framework/src/Illuminate/Cache/MemcachedStore.php(92): Illuminate\Cache\MemcachedStore::many
#72 /vendor/laravel/framework/src/Illuminate/Cache/Repository.php(125): Illuminate\Cache\Repository::many
#71 /vendor/laravel/framework/src/Illuminate/Cache/CacheManager.php(396): Illuminate\Cache\CacheManager::__call
#70 /vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Support\Facades\Facade::__callStatic

Steps To Reproduce:

Use the Memcached store and invoke Cache::many with a set of keys where some are in the cache and some are not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions