src/MySQLReplication/Event/RowEvent/RowEvent.php
protected function getBit(array $column)
    {
        $res = '';
        for ($byte = 0; $byte < $column['bytes']; ++$byte) {
            $current_byte = '';
            $data = $this->binaryDataReader->readUInt8();
            if (0 === $byte) {
                if (1 === $column['bytes']) {
                    $end = $column['bits'];
                } else {
                    $end = $column['bits'] % 8;
                    if (0 === $end) {
                        $end = 8;
                    }
                }
            } else {
                $end = 8;
            }

            for ($bit = 0; $bit < $end; ++$bit) {
                if ($data & (1 << $bit)) {
                    $current_byte .= '1';
                } else {
                    $current_byte .= '0';
                }

            }
            $res .= strrev($current_byte);
        }

        return $res;
    }
protected function getBit(array $column)
    {
        $res = '';
        for ($byte = 0; $byte < $column['bytes']; ++$byte) {
            $current_byte = '';
            $data = $this->binaryDataReader->readUInt8();
            if (0 === $byte) {
                if (1 === $column['bytes']) {
                    $end = $column['bits'];
                } else {
                    $end = $column['bits'] % 8;
                    if (0 === $end) {
                        $end = 8;
                    }
                }
            } else {
                $end = 8;
            }

            for ($bit = 0; $bit < $end; ++$bit) {
                if ($data & (1 << $bit)) {
                    $current_byte .= '1';
                } else {
                    $current_byte .= '0';
                }

            }
            $res .= strrev($current_byte);
        }

        return $res;
    }
protected function getBit ( array $ column ) { $ res = '' ; for ( $ byte = 0 ; $ byte < $ column [ 'bytes' ] ; ++ $ byte ) { $ current_byte = '' ; $ data = $ this -> binaryDataReader -> readUInt8 ( ) ; if ( 0 === $ byte ) { if ( 1 === $ column [ 'bytes' ] ) { $ end = $ column [ 'bits' ] ; } else { $ end = $ column [ 'bits' ] % 8 ; if ( 0 === $ end ) { $ end = 8 ; } } } else { $ end = 8 ; } for ( $ bit = 0 ; $ bit < $ end ; ++ $ bit ) { if ( $ data & ( 1 << $ bit ) ) { $ current_byte .= '1' ; } else { $ current_byte .= '0' ; } } $ res .= strrev ( $ current_byte ) ; } return $ res ; }
Read MySQL BIT type
@param array $column
@return string
Read MySQL BIT type