Issue Task Closed

#100168Introduce Map data-structure

Oliver Hader 03/14/23, 21:11 updated 01/30/24, 09:01

Description

Unfortunately PHP emphasizes “weak” over “map” in their new PHP 8
data-structure \WeakMap. As a result it cannot be passed to other
functions that would enrich an existing \WeakMap – since objects
created in that function scope would not exist outside and thus
directly trigger garbage collection of \WeakMap.

As a substitute, \TYPO3\CMS\Core\Type\Map is introduce with has a
similar behavior and got an additional Map::fromEntries() factory.

Example:

$map = new \TYPO3\CMS\Core\Type\Map();
$key = new \stdClass();
$value = new \stdClass();
$map[$key] = $value;

foreach ($map as $key => $value) { ... }

Reviews 1

History 611

  1. Oliver Hader changed tracker Bug Task 03/14/23, 21:11

  2. Gerrit Code Review pushed patch set 1 for main to change 78127 status New Under Review 03/14/23, 21:17

  3. Oliver Hader changed description status Under Review New 03/14/23, 21:18

  4. Oliver Hader changed status New Under Review 03/14/23, 21:18

  5. Gerrit Code Review pushed patch set 2 for main to change 78127 03/14/23, 21:25

  6. Gerrit Code Review pushed patch set 3 for main to change 78127 03/14/23, 21:37

  7. Gerrit Code Review pushed patch set 4 for main to change 78127 03/14/23, 21:41

  8. Gerrit Code Review pushed patch set 5 for main to change 78127 03/14/23, 22:40

  9. Oliver Hader changed description 03/14/23, 22:42

  10. Oliver Hader commented and changed status Under Review Resolved done 0 % 100 % 03/15/23, 08:55

    Applied in changeset commit:008a7af094876a8bb1710d8a7503a486b6c1ce3b.

  11. Benni Mack changed status Resolved Closed 01/30/24, 09:01