Review 13.4 Merged

90882[TASK] Mitigate "Using null as an array offset is deprecated"

Stefan Bürk CR +2 V +2 Normal +33 −31 updated 10/02/25, 21:00

Commit message

PHP 8.5.0 deprecates using null as an array offset and recommends
to use an empty string instead, see full deprecation message:

> Using null as an array offset is deprecated,
> use an empty string instead

Using

> $array['']

instead of

> $array[null]

is considered safe as php writes `null` key assignments to empty
string anyway:

> $array[null] = 'some';
> var_dump($array);
>
> $array = ['' => 'some'];

This change modifies code places hitting this deprecation found by
executing tests (unit && functional) with current `PHP8.5.0beta3`
image to prepare towards PHP 8.5 support.

Note this only covers all places that can be back ported easily.
Further patches will take care of remaining one found by tests.

[1] https://github.com/php/php-src/commit/49e3956b703b4aeb24c7a42ae3ee89e2a339560d
[2] https://github.com/php/php-src/blob/03c9d2303eea3a90be88a729d331da3bc4488aac/UPGRADING#L387-L389

Review

  • Code review CR +2 Done
    • Stefan Bürk +2
  • Verified V +2 Done
    • Stefan Bürk +2
    • core-ci +1 CI

Issues 1

Files 15

Review log 34

  1. Stefan Bürk uploaded patch set 1 10/02/25, 20:45

  2. core-ci voted on patch set 1 V +1 10/02/25, 20:51 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85937

  3. Stefan Bürk voted on patch set 1 CR +2 V +2 10/02/25, 21:00

  4. Stefan Bürk merged patch set 2 10/02/25, 21:00