$prefixes[substr($char, 0, $len)] = true;
}
- $varLength = function($prefix) use($valid, &$invalid, &$truncated) {
+ $varLength = function($prefix) use($valid, $prefixes, &$invalid, &$truncated, &$varLength) {
for ($byte = 0; $byte < 256; $byte++) {
$str = $prefix . chr($byte);
if (!isset($valid[$str])) {
}
};
- $fixedLength = function($prefix, $remaining) use($valid, &$invalid, &$truncated, &$fixedLength) {
+ $fixedLength = function($prefix, $remaining) use($valid, $prefixes, &$invalid, &$truncated, &$fixedLength) {
if ($remaining == 0) {
if (!isset($valid[$prefix]))
$invalid[$prefix] = true;