My idea is that there are two new operators: &= and |=. They'd work like this:
$booleanArray = array(true, true, false);
$andCondition = true;
$orCondition = false;
foreach($booleanArray as $bool)
{
$andCondition &= $bool;
$orCondition |= $bool;
}
// $andCondition is now false, since T & (T & T & F) = F
// $orCondition is now true, since F | (T | T | F) = T
(Fingers crossed Dorm doesn't weigh in with a "it already exists" comment).
What would you like to see in PHP?
This post has been edited by Dormilich: 17 March 2012 - 03:18 AM
Reason for edit:: Rep++ for the comment

New Topic/Question
Reply


MultiQuote





|