Multiple choice php

How does the identity operator === compare two values?

  1. It converts them to a common compatible data type and then compares the resulting values

  2. It returns True only if they are both of the same type and value

  3. If the two values are strings, it performs a lexical comparison

  4. It bases its comparison on the C strcmp function exclusively

Reveal answer Fill a bubble to check yourself
B Correct answer
Explanation

The identity operator (=) checks for both value and type equality without performing type coercion. For the expression to be true, both operands must be of the same data type (e.g., both integers) and have the same value. This differs from '', which allows type juggling.