I recently came across a bug in some code at work where a series of function calls were aggregated into a single success condition. Something like
$success = true;
foreach($foo as $f) {
$success = $success && do_foo($f);
}
The bug is do_foo() was intended to run across the entire collection (it has side-effects). but the && operator short-circuts and once once a false is encountered do_foo isn't called on the remainder of the collection. Easy enough to refactor, but it led me to wondering:
Does PHP have a logical operator that does not short-circut?
Edit: Let me be clear, I'm not asking how to solve the bug. This is a hypothetical question about syntax.