diff --git a/example.php b/example.php index b4d0c0d..039fe6c 100644 --- a/example.php +++ b/example.php @@ -10,6 +10,7 @@ var_dump(\danog\PHP\Struct::unpack('2cxbxBx?xhxHxixIxlxLxqxQxnxNxfxdx2sx5pP', ) )); -var_dump(\danog\PHP\Struct::calcsize('n')); + +var_dump(bin2hex(\danog\PHP\Struct::pack('q', 999999999999))); // 2c x b x B x ? x h x H x i x I x l x L x q x Q x n x N x f x d x 2s x //print(struct.unpack("2cxbxBx?xhxHxixIxlxLxqxQxnxNxfxdx2sx", struct.pack("2cxbxBx?xhxHxixIxlxLxqxQxnxNxfxdx2sx", "nv", 100, 100, False, 333, 444, 232423, 234342, 234234234234, 234234234234, 234234234234, 234234234234, 34434, 344434, 2.2343, 3.03424, "dd"))); diff --git a/lib/danog/PHP/Struct.php b/lib/danog/PHP/Struct.php index 85f7164..eaecc47 100644 --- a/lib/danog/PHP/Struct.php +++ b/lib/danog/PHP/Struct.php @@ -589,7 +589,6 @@ class Struct public function manual_q_pack($n, $blocksize = 8) { $s = null; - $n = (int)$n; while ($n > 0) { $s = $this->pack('>I', $n & 4294967295).$s; $n = $n >> 32;