Skip to content
Make room for learningYour learning studio
Compare without coercion4 min

Loading your session…

A small idea, worth understanding

Compare without coercion

Choose strict comparison when type matters.

PHP's === operator compares both value and type. The == operator may convert types before comparing.

A numeric string and an integer are different types even when their characters look similar.

Two activities. No typing needed. You can always retry, or read an explanation and continue.

Read the full lesson first