Use isset with multiple parameters where possible

Created on 22 May 2015, over 10 years ago
Updated 13 August 2025, 10 days ago

Problem/Motivation

PHP isset allows the use of multiple parameters to be passed in a single isset call. Instead of doing a multiple consequetive isset($a) && isset($b) calls, we can do isset($a, $b). Naturally this leads to less code and less possible confusion with the use of boolean operators and therefore less possible bugs. Should be noted that performance boost is negligible.

Proposed resolution

Wherever found, replace consequetive non negated AND combined issets with a single one.

Patch as an example.

📌 Task
Status

Postponed: needs info

Version

11.0 🔥

Component

other

Created by

🇫🇮Finland tcmug

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

  • stale-issue-cleanup

    To track issues in the developing policy for closing stale issues, [Policy, no patch] closing older issues

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.

  • 🇺🇸United States smustgrave

    Thank you for creating this issue to improve Drupal.

    We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.

    Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.

    Thanks!

  • 🇧🇪Belgium borisson_ Mechelen, 🇧🇪

    I believe it is still relevant - though I am personally not a fan, but without a coding standards issue we shouldn't get this in. I think we need to create a CS issue and postpone this one on that.

Production build 0.71.5 2024