#107541Mitigate "Using null as an array offset is deprecated"
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
-
Gerrit Code Review pushed patch set 1 for main to change 90799 status
NewUnder Review 09/25/25, 15:55 -
Gerrit Code Review pushed patch set 2 for main to change 90799 10/01/25, 16:20
-
Gerrit Code Review pushed patch set 3 for main to change 90799 10/02/25, 14:55
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 90882 10/02/25, 20:45
-
Gerrit Code Review pushed patch set 1 for 12.4 to change 90883 10/02/25, 20:52
-
Stefan Bürk commented and changed status
Under ReviewResolved done0 %100 % 10/02/25, 21:05 -
Benni Mack changed status
ResolvedClosed 12/02/25, 13:04
Applied in changeset commit:9a6c9f06df880746dfcca1c1f418dcaa3f294c03.