Function name, class name, namespace name or constant name can not be reserved keyword '__DIR__'

Created on 25 November 2020, almost 4 years ago
Updated 13 September 2024, 2 months ago

Problem/Motivation

Several issues related to "Function name, class name, namespace name or constant name can not be reserved keyword '__DIR__'" get flagged by PHPCompatibility.

Steps to reproduce

phpcs --standard=PHPCompatibility --runtime-set testVersion 7.3 sites/all/themes/bootstrap/template.php

File themes/bootstrap/template.php

FOUND 2 ERRORS AFFECTING 2 LINES
------------------------------------------------------------------------------------------------------
4 | ERROR | Function name, class name, namespace name or constant name can not be reserved keyword
| | '__DIR__' (since version 5.3)
5 | ERROR | Function name, class name, namespace name or constant name can not be reserved keyword
| | '__DIR__' (since version 5.3)
------------------------------------------------------------------------------------------------------

πŸ› Bug report
Status

Closed: won't fix

Version

2.2

Component

Code

Created by

πŸ‡ΈπŸ‡ͺSweden dennismathenge

Live updates comments and jobs are added and updated live.
  • PHP 7.3

    The issue particularly affects sites running on PHP version 7.3.0 or later.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024