40
This is in fact a common pattern and will work. However, you may want to think twice about using it for more complex cases, or at all. Imagine if someone maintaining your code comes along and sees
if ($x = one() || $y = two() && $z = three() or four()) {
}
It might be better to declare the variables before using them in the conditional.