public function check($element)
    {
        if (!is_scalar($element)) {
            $element = serialize($element);
        }

        $hashes = $this->hash($element);

        foreach ($hashes as $hash) {

            $offset = (int)floor($hash / 8);
            $bit = (int)($hash % 8);

            if (!(ord($this->filter[$offset]) & (2 ** $bit))) {
                return false;
            }
        }

        return true;
    }
public function check($element)
    {
        if (!is_scalar($element)) {
            $element = serialize($element);
        }

        $hashes = $this->hash($element);

        foreach ($hashes as $hash) {

            $offset = (int)floor($hash / 8);
            $bit = (int)($hash % 8);

            if (!(ord($this->filter[$offset]) & (2 ** $bit))) {
                return false;
            }
        }

        return true;
    }
public function check ( $ element ) { if ( ! is_scalar ( $ element ) ) { $ element = serialize ( $ element ) ; } $ hashes = $ this -> hash ( $ element ) ; foreach ( $ hashes as $ hash ) { $ offset = ( int ) floor ( $ hash / 8 ) ; $ bit = ( int ) ( $ hash % 8 ) ; if ( ! ( ord ( $ this -> filter [ $ offset ] ) & ( 2 ** $ bit ) ) ) { return false ; } } return true ; }
Is element in the hash

@param mixed $element

@return boolean
Beware that a strict false means strict false, while a strict true
means "probably with a X% probably" where X is the value you built
the filter with.
Is element in the hash