Bigtable/src/DataUtil.php
public static function intToByteString($intValue)
    {
        if (!self::isSupported()) {
            throw new \RuntimeException('This utility is only supported on 64 bit machines with PHP version > 5.5.');
        }
        if (!is_int($intValue)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Expected argument to be of type int, instead got \'%s\'.',
                    gettype($intValue)
                )
            );
        }
        $bytes = pack("J", $intValue);
        return $bytes;
    }
public static function intToByteString($intValue)
    {
        if (!self::isSupported()) {
            throw new \RuntimeException('This utility is only supported on 64 bit machines with PHP version > 5.5.');
        }
        if (!is_int($intValue)) {
            throw new \InvalidArgumentException(
                sprintf(
                    'Expected argument to be of type int, instead got \'%s\'.',
                    gettype($intValue)
                )
            );
        }
        $bytes = pack("J", $intValue);
        return $bytes;
    }
public static function intToByteString ( $ intValue ) { if ( ! self :: isSupported ( ) ) { throw new \ RuntimeException ( 'This utility is only supported on 64 bit machines with PHP version > 5.5.' ) ; } if ( ! is_int ( $ intValue ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Expected argument to be of type int, instead got \'%s\'.' , gettype ( $ intValue ) ) ) ; } $ bytes = pack ( "J" , $ intValue ) ; return $ bytes ; }
Utility method to convert an integer to a 64-bit big-endian signed integer byte string.

@param int $intValue Integer value to convert to.
@return string Returns a string of bytes representing a 64-bit big-endian signed integer.
@throws \InvalidArgumentException If value is not an integer.
@throws \RuntimeException If called on PHP version <= 5.5.
Utility method to convert an integer to a 64 - bit big - endian signed integer byte string .