Bird
0
0

Which statement about the logical XOR operator in PHP is true?

hard📝 Conceptual Q10 of 15
PHP - Operators
Which statement about the logical XOR operator in PHP is true?
AXOR returns true if both operands are true
BXOR behaves the same as OR
CXOR returns true if both operands are false
DXOR returns true if exactly one operand is true
Step-by-Step Solution
Solution:
  1. Step 1: Understand XOR behavior

    XOR returns true only if exactly one operand is true, not both or none.
  2. Step 2: Compare with other operators

    AND needs both true, OR needs at least one true, XOR is exclusive OR.
  3. Final Answer:

    XOR returns true if exactly one operand is true -> Option D
  4. Quick Check:

    XOR = true if one true only [OK]
Quick Trick: XOR is true only when one operand is true [OK]
Common Mistakes:
  • Thinking XOR is same as OR
  • Assuming XOR true if both true
  • Confusing XOR with AND

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes