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 votesComments