PHP 8.3 compatibility updates

Created on 20 June 2025, 19 days ago

Problem/Motivation

In preparation for migrating to PHP 8.3 I ran a PHPCompatibility test for the 8.3 version. These were the results:

FILE: /var/www/html/docroot/modules/contrib/access_policy/src/Entity/AccessPolicy.php
----------------------------------------------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
----------------------------------------------------------------------------------------------------------------------
 211 | ERROR | Indirect access to variables, properties and methods will be evaluated strictly in left-to-right order
     |       | since PHP 7.0. Use curly braces to remove ambiguity.
 219 | ERROR | Indirect access to variables, properties and methods will be evaluated strictly in left-to-right order
     |       | since PHP 7.0. Use curly braces to remove ambiguity.
 249 | ERROR | Indirect access to variables, properties and methods will be evaluated strictly in left-to-right order
     |       | since PHP 7.0. Use curly braces to remove ambiguity.
----------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/docroot/modules/contrib/access_policy/src/Plugin/access_policy/SelectionRule/Numeric.php
----------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------
 12 | WARNING | 'numeric' is a soft reserved keyword as of PHP version 7.0 and should not be used to name a class,
    |         | interface or trait or as part of a namespace (T_CLASS)
----------------------------------------------------------------------------------------------------------------------

Steps to reproduce

Run phpcs -d memory_limit=1G --standard=PHPCompatibility --runtime-set testVersion 8.3 -q --extensions=php,inc,module,theme ./docroot/modules/contrib on the codebase.

Proposed resolution

Fix all code that will throw errors or warnings when using PHP 8.3 to run your Drupal instance.

πŸ“Œ Task
Status

Active

Version

1.0

Component

Code

Created by

πŸ‡ΊπŸ‡ΈUnited States oo0shiny

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.71.5 2024