👋 Hello! I'm Alphonsio the robot. Ask me a question, I'll try to answer.

How to make strict type comparison in PHP switch...case?

You cannot make strict type comparisons in PHP switch case. In other words, you can't use a === comparison in switch statements as stated in the documentation:


Note:Note that switch/case does loose comparison.


Loose comparison is the opposite of strict comparison.

More