Skip to content

[Redis] Cannot use bool as array on PHP 8.5 #57908

@CicerBro

Description

@CicerBro

Laravel Version

12.40.1

PHP Version

8.5.0

Database Driver & Version

No response

Description

❯ artisan cache:prune-stale-tags

   ErrorException

  Cannot use bool as array

  at vendor/laravel/framework/src/Illuminate/Cache/RedisStore.php:335
    331▕
    332▕             do {
    333▕                 [$cursor, $tagsChunk] = $connection->scan(
    334▕                     $cursor,
  ➜ 335▕                     ['match' => $prefix.'tag:*:entries', 'count' => $chunkSize]
    336▕                 );
    337▕
    338▕                 if (! is_array($tagsChunk)) {
    339▕                     break;

      +2 vendor frames

  3   [internal]:0
      Illuminate\Support\LazyCollection::{closure:Illuminate\Support\LazyCollection::map():826}()
      +17 vendor frames

  21  artisan:13
      Illuminate\Foundation\Application::handleCommand()

Seemingly started after upgrading to 8.5 in my dev container. $connection->scan() can return false according to docs.

Steps To Reproduce

PHP 8.5
Laravel 12.40.1

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