Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)

Created on 24 April 2021, over 3 years ago
Updated 14 August 2023, over 1 year ago

Problem/Motivation

Notice thrown when on PHP 7.4

Deprecated: Unparenthesized `a ? b : c ? d : e` is deprecated. Use either `(a ? b : c) ? d : e` or `a ? b : (c ? d : e)` in sites/all/modules/ms_core/ms_core.forms.inc on line 1425

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

🐛 Bug report
Status

Needs review

Version

10.0

Component

Code

Created by

🇳🇱Netherlands spokje

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.

  • 🇦🇺Australia fenstrat Australia

    Looks like the correct approach. #2 fixes static analysis:

    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

  • Status changed to Needs review over 1 year ago
  • Open in Jenkins → Open on Drupal.org →
    Core: 7.x + Environment: PHP 5.3 & MySQL 5.5
    last update over 1 year ago
    6 pass
  • 🇦🇺Australia fenstrat Australia

    Actually a couple more nested ternaries needed adjusting. These things are a nightmare.

Production build 0.71.5 2024