Difference between two and three equal signs in comparisons
Question by Guest | Last update on 2021-05-04 | Created on 2012-08-11
I recently found a comparison with three equal signs in a script. Otherwise, I have always known only comparisons with two equals signs.
According to my tests, it does not matter whether you take two or three equal signs. So, what is this?
Related Topics
Which animal am I in the Chinese Horoscope?
Info | 0 Comments
PHP: Fill Array with Sequence of Numbers or Characters
Tutorial | 0 Comments
MySQL: Delete Data from Table - Difference between TRUNCATE, DELETE and DROP
Tutorial | 0 Comments
Chinese Horoscope: Zodiac Signs and Elements
Info | 0 Comments
Car Purchase: How to detect a manipulated tachometer?
Info | 0 Comments
Difference between Bike Path and Bicycle Road in Germany (Radweg and Fahrradstraße)
Question | 1 Answer
Micro SD Memory Cards: Difference between microSD, microSDHC, microSDXC and microSDUC
Info | 12 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
The operator == as well as the operator === are both comparision operators.
Here is an example:
We define 3 variables with identical values and then cast the variables on the types Integer or Double. Then, we compare the variables in pairs.
When compared with the two equal signs, every time we get out true. In the three equal sign comparison, however, we get only true if the types are also the same.
Last update on 2021-05-04 | Created on 2012-08-12