Plugin Directory

Changeset 3455441


Ignore:
Timestamp:
02/06/2026 01:53:51 PM (7 weeks ago)
Author:
whiteshadow
Message:

Attempted fix for a PHP compatibility issue where using PHP versions older than 8.1 could lead to errors like "Fatal error: Uncaught Error: Cannot unpack Traversable with string keys".

File:
1 edited

Legend:

Unmodified
Added
Removed
  • admin-menu-editor/trunk/includes/module.php

    r3442103 r3455441  
    326326
    327327    public function getIterator(): Traversable {
    328         return new ArrayIterator($this->selectedDeps);
     328        //PHP < 8.1 compatibility: We use the iterator with a splat operator later, which
     329        //doesn't support arrays/Traversable with string keys. So we reindex the array here.
     330        return new ArrayIterator(array_values($this->selectedDeps));
    329331    }
    330332
Note: See TracChangeset for help on using the changeset viewer.