The left-associativity of the ternary operator has been deprecated in PHP 7.4

Created on 19 January 2021, almost 4 years ago
Updated 11 May 2023, over 1 year ago

Problem/Motivation

select_with_style/select_with_style/select_with_style.module
168 | ERROR | The left-associativity of the ternary operator has been deprecated in PHP 7.4 and removed in PHP 8.0. Multiple consecutive ternaries detected. Use parenthesis to clarify the order in which the operations should be executed

Steps to reproduce

phpcs --standard=PHPCompatibility --extensions=php,module,inc,install,test,profile,theme .

Proposed resolution

Cast to array.
Example how this works in all cases:
https://3v4l.org/cqM0B

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

RTBC

Version

1.0

Component

Code

Created by

🇨🇦Canada joelpittet Vancouver

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

    The issue particularly affects sites running on PHP version 7.4.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