Wednesday, March 6, 2019

comparison - Is there a difference between !== and != in PHP?




Is there a difference between !== and != in PHP?


Answer



The != operator compares value, while the !== operator compares type as well.



That means this:



var_dump(5!="5"); // bool(false)
var_dump(5!=="5"); // bool(true), because "5" and 5 are of different types

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...