Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between !== and != in PHP? [duplicate]

Possible Duplicate:
php == vs === operator

What's the difference between !== and != in PHP?

like image 998
Steven Avatar asked Aug 04 '26 03:08

Steven


2 Answers

!== is strict not equal and which does not do type conversion

!= is not equal which does type conversion before checking

like image 121
rahul Avatar answered Aug 05 '26 16:08

rahul


=== AND !== checks if the values compared have the same type (eg: int, string, etc.) and have the same values

While...

== AND != only compares the values

like image 37
wenbert Avatar answered Aug 05 '26 17:08

wenbert



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!