Skip to content

Proposal use logical_operators #48

@susnux

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions