'object' is a reserved keyword PHP >= 7.2

Created on 23 November 2019, about 5 years ago
Updated 21 March 2023, over 1 year ago

Problem/Motivation

While testing PHP 7.3 compatibility, I've run into the following errors:


FILE: /mnt/src/web/modules/contrib/jsonrpc/src/Object/Request.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 3 | ERROR | 'object' is a soft reserved keyword as of PHP version 7.0 and a reserved keyword as of PHP version 7.2 and
   |       | should not be used to name a class, interface or trait or as part of a namespace (T_NAMESPACE)
------------------------------------------------------------------------------------------------------------------------


FILE: /mnt/src/web/modules/contrib/jsonrpc/src/Object/Error.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 3 | ERROR | 'object' is a soft reserved keyword as of PHP version 7.0 and a reserved keyword as of PHP version 7.2 and
   |       | should not be used to name a class, interface or trait or as part of a namespace (T_NAMESPACE)
------------------------------------------------------------------------------------------------------------------------


FILE: /mnt/src/web/modules/contrib/jsonrpc/src/Object/ParameterBag.php
------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------
 3 | ERROR | 'object' is a soft reserved keyword as of PHP version 7.0 and a reserved keyword as of PHP version 7.2 and
   |       | should not be used to name a class, interface or trait or as part of a namespace (T_NAMESPACE)
------------------------------------------------------------------------------------------------------------------------

Proposed resolution

Rename Object to Obj.

πŸ› Bug report
Status

Closed: duplicate

Component

Code

Created by

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