title: PHP: Assigning values to a variable inside IF statement
body: <p>I was wondering if i could assign values to a variable inside an IF statement. My code is as follows: </p>
  
  <pre><code>&lt;?php
      if ((count($newArray) = array("hello", "world")) == 0) {
          // do something
      }
  ?&gt;
  </code></pre>
  
  <p>So basically i want assign the array to the $newArray variable, then count newArray and check to see if it is an empty array.</p>
  
  <p>I know i can do this on several lines but just wondered if i could do it on one line</p>