While loop with assignment operator <p>I can't seem to figure out how this loop works in PHP:</p> <pre><code>$people = array(); while($row = $result-&gt;fetch_assoc()) $people[] = $row; </code></pre> <p>It seems as though the loop would just keep going, infinitely. But, it doesn't How exactly does this work? Can someone explain it to me step-by-step? I'm guessing that the while loop could also be written like this:</p> <pre><code>while(($row = $result-&gt;fetch_assoc()) == true) </code></pre>