1.2.601. Invalid Pack Format¶
Some characters are invalid in a pack() format string.
pack() and unpack() accept the following format specifiers : aAhHcCsSnviIlLNVqQJPfgGdeExXZ
.
unpack() also accepts a name after the format specifier and an optional quantifier.
All other situations is not a valid, and produces a warning : pack(): Type t: unknown format code
.
Check pack() documentation for format specifiers that were introduced in various PHP version, namely 7.0, 7.1 and 7.2.
<?php
$binarydata = pack("nvc*", 0x1234, 0x5678, 65, 66);
// the first unsigned short is stored as 'first'. The next matches are names with numbers.
$res = unpack('nfirst/vc*', $binarydata);
?>
1.2.601.2. Connex PHP features¶
1.2.601.2.1. Suggestions¶
Fix the packing format with correct values
1.2.601.2.2. Specs¶
Short name |
Structures/InvalidPackFormat |
Rulesets |
|
Exakat since |
1.4.9 |
PHP Version |
All |
Severity |
Major |
Time To Fix |
Quick (30 mins) |
Precision |
High |
Available in |