title: Type-juggling and (strict) greater/lesser-than comparisons in PHP
body: <p>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.</p>
  
  <p>For example: If <code>$a &gt; $b</code> is true and <code>$b &gt; $c</code> is true, must it mean that <code>$a &gt; $c</code> is <em>always</em> true too?</p>
  
  <p>Following basic logic, I would say <em>yes</em> however I'm that puzzled I do not really trust PHP in this. Maybe someone can provide an example where this is not the case?</p>
  
  <p>Also I'm wondering with the strict lesser-than and strict greater-than operators (as their meaning is described as strictly which I only knew in the past from the equality comparisons) if it makes any difference if left and right operands are swapped with strictly unequal values:</p>
  
  <pre><code># Precondition:
  if ($a === $b) {
      throw new Exception(
         'Both are strictly equal - can not compare strictly for greater or smaller'
      );
  }
  
  ($a &gt; $b) !== ($b &gt; $a)
  </code></pre>
  
  <p>For most of all type comparison combinations these <a href="http://php.net/language.operators.comparison" rel="noreferrer">greater / lesser comparison operators</a> are not documented, so reading the manual was not really helpful in this case.</p>