Interesting behavior comparing integer with array in PHP
<p>In PHP I had to compare if an integer variable was less than a value of an array, but I had an error in the code and I found by chance an unexpected behavior.</p>

<p>I was comparing the integer with the array itself and it was returning true. Do you know why?</p>

<p>I've been searching about this in StackOverflow and php.net <a href="http://php.net/manual/en/types.comparisons.php" rel="nofollow" title="this article">(PHP types comparisons)</a> and I didn't found a specific answer.</p>

<p>Here you have a little code to test this.</p>

<pre><code>&lt;?php

$myArray = array();
$myInt = 1;

if($myInt &lt; $myArray){
    echo "Int less than array\n";
}

if($myInt == $myArray){
    echo "Int equal to array\n";
}

if($myInt &gt; $myArray){
    echo "Int greater than array\n";
}
</code></pre>

<p>I've tried different values for <code>$myInt</code> and different contents for <code>$myArray</code> and it always prints this:</p>

<pre><code>Int less than array
</code></pre>