Bird
0
0

Given the variables:

hard📝 Application Q15 of 15
PHP - Operators
Given the variables:
$a = false;
$b = true;
$c = false;

Which expression evaluates to true?
($a || $b) && !$c
Anull
Bfalse
CSyntax Error
Dtrue
Step-by-Step Solution
Solution:
  1. Step 1: Evaluate the OR inside parentheses

    $a is false, $b is true, so $a || $b is true.
  2. Step 2: Evaluate the NOT operator on $c

    $c is false, so !$c is true.
  3. Step 3: Evaluate the AND between results

    true AND true equals true.
  4. Final Answer:

    true -> Option D
  5. Quick Check:

    (false OR true) AND NOT false = true [OK]
Quick Trick: Evaluate inside parentheses first, then NOT, then AND [OK]
Common Mistakes:
  • Ignoring operator precedence
  • Misapplying NOT operator
  • Assuming OR returns false if one operand is false

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More PHP Quizzes