$g){ $r <<= 1; $r |= $a[$f]; } return $r; } static function binarray($a,$m){ foreach($a as $f => $g){ $a[$f] = $m&1; $m>>=1; } return $a; } }