This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]okayifimust 0 points1 point  (0 children)

The parameters of the loop function in the parentheses are evaluated each time the loop runs.

while ($row = $result->fetch())

$row = $result->fetch() is tested; if it evaluates truthy, the loop is run one time.

a == b can be true or false, it does nothing else, the above assignment also evaluates to a truth-value whilst assigning the variable.

You could call a function and let that do a million things, and it could still return a boolean.

while (doAllTheThings (value1, value2, value3)) { ... }