Quantcast
Channel: Type-juggling and (strict) greater/lesser-than comparisons in PHP - Stack Overflow
Browsing all 4 articles
Browse latest View live

Answer by Walter Tross for Type-juggling and (strict) greater/lesser-than...

After your correction of the second part of your question, I leave the answer to that part to the others. I just want to give the most surprising answer to the first part of your question, i.e.,...

View Article



Answer by CSᵠ for Type-juggling and (strict) greater/lesser-than comparisons...

There are nostrict identical comparison operators (>== or <==) in PHP (by PHP 5.6.14 at least), but there are a few ways to enforce a strict type check before checking Greater/Lower:Check both...

View Article

Answer by NikiC for Type-juggling and (strict) greater/lesser-than...

PHP's comparison operators deviate from the computer-scientific definitions in several ways:In order to constitute an equivalence relation== has to be reflexive, symmetric and transitive:PHP's ==...

View Article

Type-juggling and (strict) greater/lesser-than comparisons in PHP

PHP is famous for its type-juggling. I must admit it puzzles me, and I'm having a hard time to find out basic logical/fundamental things in comparisons.For example: If $a > $b is true and $b > $c...

View Article
Browsing all 4 articles
Browse latest View live


Latest Images