John Davidson

php - Are comparison format and and or satisfy the PSR12 standard?

0 comments
Message:


Considering this fragment of code


if ($x > 0 and $x !== 1)   {
return;
}

Is the comparison operator expressed as and and or rather than && and || considered acceptable according to the PSR-12 standard?



My Answer:
No, according to the PSR-12 standard, the comparison operators should be expressed as && for "and" and || for "or". Using "and" and "or" instead of && and || would not be considered acceptable according to the PSR-12 standard.

Rate this post

5 of 5 based on 3514 votes

Comments




© 2024 Hayatsk.info - Personal Blogs Platform. All Rights Reserved.
Create blog  |  Privacy Policy  |  Terms & Conditions  |  Contact Us