diff --git a/example.php b/example.php index 039fe6c..edfc364 100644 --- a/example.php +++ b/example.php @@ -5,7 +5,8 @@ require 'lib/danog/PHP/Struct.php'; //var_dump(["nv", 61, 61, false, 333, 444, 232423, 234342, 243342423424, 234234234234, 234234234234, 234234234234, 34434, 344434, 2.2343, 3.03424, "dd"]); var_dump(\danog\PHP\Struct::unpack('2cxbxBx?xhxHxixIxlxLxqxQxnxNxfxdx2sx5pP', \danog\PHP\Struct::pack('2cxbxBx?xhxHxixIxlxLxqxQxnxNxfxdx2sx5pP', -'n', 'v', 100, 100, false, 333, 444, 232423, 234342, 234234234234, 234234234234, 234234234234, 234234234234, 34434, 344434, 2.2343, +'n', 'v', 100, 100, false, 333, 444, 232423, 234342, 234234234234, 234234234234, 888888888888, +888888888888, 34434, 344434, 2.2343, 3.03424, 'df', 'asdfghjkl', 1283912 ) diff --git a/lib/danog/PHP/Struct.php b/lib/danog/PHP/Struct.php index eaecc47..ea57561 100644 --- a/lib/danog/PHP/Struct.php +++ b/lib/danog/PHP/Struct.php @@ -341,7 +341,7 @@ class Struct break; case 'q': case 'Q': - $result[$arraycount] = $this->IS64BIT ? implode('', unpack($command['phpformat'].$command['count'], $dataarray[$command['datakey']])) : $this->manual_q_unpack($command['count'], $dataarray[$command['datakey']]); + $result[$arraycount] = $this->IS64BIT ? implode('', unpack($command['phpformat'].$command['count'], $dataarray[$command['datakey']])) : $this->manual_q_unpack($dataarray[$command['datakey']]); break; default: $result[$arraycount] = implode('', unpack($command['phpformat'].$command['count'], $dataarray[$command['datakey']])); // Unpack current char