Issue Bug Closed

#107352Use array accessory inside \TYPO3\CMS\Core\Type\Map

Oliver Hader 08/29/25, 13:04 updated 12/02/25, 13:58

Description

PoC

<?php
require_once 'vendor/autoload.php';

$aKey = new \stdClass();
$aKey->value = 'a';
$bKey = new \stdClass();
$bKey->value = 'b';
$cKey = new \stdClass();
$cKey->value = 'c';

$map = new \TYPO3\CMS\Core\Type\Map();
$map[$aKey] = 'a';
$map[$bKey] = 'b';
$map[$cKey] = 'c';

$map->next();
$map->next();
var_dump($map->current());
// -->> shows `c`

unset($map[$aKey]);
var_dump($map->current());
// -->> shows `b`, expected to still show `c` (since `a` was removed, `c` is still available)

$map->next();
$map->next();
var_dump($map->key());
// -->> throws `RuntimeException: Called current() on invalid iterator`

Reviews 3

History 310

  1. Oliver Hader commented and changed status Under Review Resolved done 0 % 100 % <span data-processor="relativetime" data-value="2025-08-29T18:25:09+00:00" > 08/29/25, 18:25 </span>

    Applied in changeset commit:9ae150246a0326c069dd98ea0fff52101d3ba36a.