Issue Task Closed

#107541Mitigate "Using null as an array offset is deprecated"

Stefan Bürk 09/25/25, 15:46 updated 12/02/25, 13:04

Description

PHP8.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’];

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

Reviews 3

History 27

  1. Gerrit Code Review pushed patch set 1 for main to change 90799 status New Under Review 09/25/25, 15:55

  2. Gerrit Code Review pushed patch set 2 for main to change 90799 10/01/25, 16:20

  3. Gerrit Code Review pushed patch set 3 for main to change 90799 10/02/25, 14:55

  4. Gerrit Code Review pushed patch set 1 for 13.4 to change 90882 10/02/25, 20:45

  5. Gerrit Code Review pushed patch set 1 for 12.4 to change 90883 10/02/25, 20:52

  6. Stefan Bürk commented and changed status Under Review Resolved done 0 % 100 % 10/02/25, 21:05

    Applied in changeset commit:9a6c9f06df880746dfcca1c1f418dcaa3f294c03.

  7. Benni Mack changed status Resolved Closed 12/02/25, 13:04