3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $bitMask = 3; $allowedBitValues = array(1,2); $splited = array(); foreach($allowedBitValues as $bitValue) { var_dump($bitValue == ($bitMask & $bitValue)); if ($bitValue == ($bitMask & $bitValue)) { $splited[] = $bitValue; } } var_dump($splited);
Output for 4.3.0 - 7.1.0
bool(true) bool(true) array(2) { [0]=> int(1) [1]=> int(2) }