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. Gerrit Code Review pushed patch set 1 for main to change 90509 status New Under Review 08/29/25, 13:07

  2. Oliver Hader changed description 08/29/25, 13:15

  3. Gerrit Code Review pushed patch set 2 for main to change 90509 08/29/25, 13:44

  4. Gerrit Code Review pushed patch set 3 for main to change 90509 08/29/25, 13:48

  5. Gerrit Code Review pushed patch set 5 for main to change 90509 08/29/25, 13:52

  6. Gerrit Code Review pushed patch set 1 for 13.4 to change 90516 08/29/25, 16:47

  7. Gerrit Code Review pushed patch set 1 for 12.4 to change 90517 08/29/25, 16:47

  8. Gerrit Code Review pushed patch set 2 for 12.4 to change 90517 08/29/25, 18:15

  9. Oliver Hader commented and changed status Under Review Resolved done 0 % 100 % 08/29/25, 18:25

    Applied in changeset commit:9ae150246a0326c069dd98ea0fff52101d3ba36a.

  10. Benni Mack changed status Resolved Closed 12/02/25, 13:58