Skip to content

@mauris /gist:3481335
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Bitwise &= for multiple boolean checks
<?php
function op($d){
return $d;
}
$ok = true;
$ok &= op(true);
$ok &= op(true);
$ok &= op(true);
var_dump((bool)$ok); // yields true because all op()s are true.
// another scenario
$ok = true;
$ok &= op(true);
$ok &= op(false);
$ok &= op(true);
var_dump((bool)$ok); // yields false because one of the op()s is false.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.