Pre-recorded question

Question #86
How to use === comparison instead of == in PHP switch...case?
Answer

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.

5 events in history
Question by Alphonsio 06/14/2020 at 06:49:01 PM
How to use === comparison instead of == in PHP switch...case?
Question by Alphonsio 06/14/2020 at 06:48:53 PM
How to use === comparison instead of == in PHP switch statements?
Question by Alphonsio 06/14/2020 at 06:48:30 PM
How to make strict type comparison in PHP switch statements?
Answer by Alphonsio 06/14/2020 at 06:48:09 PM

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.

Question by Alphonsio 06/14/2020 at 06:43:57 PM
How to make strict type comparison in PHP switch...case?
# ID Query URL Count

Icons proudly provided by Friconix.