镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Proposal use logical_operators #48

Open

Description

@susnux

Forbid using and and or operators in favor of && and ||.
The reason is that and and or have non obvious different precedence, which also makes this rule risky thus we might need to discuss if we instead need to create a psalm rule for it.
See also https://www.php.net/manual/en/language.operators.precedence.php

- if ($foo and $bar)
+ if ($foo && bar)

cc @nickvergessen @provokateurin @ChristophWurst

Activity

  1. nickvergessen commented on Sep 28, 2025

    @nickvergessen
    Member

    👍

  2. provokateurin commented on Sep 28, 2025

    @provokateurin
    Member

    👍

    Just need to be careful to review all changes since the risky change could have unintended consequences.

  3. susnux commented on Sep 28, 2025

    @susnux
    Author

    Example for server: nextcloud/server#55363

  4. ChristophWurst commented on Sep 28, 2025

    @ChristophWurst
    Member

    👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions