We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2532e5e + 93d5b1c commit 9d1d50aCopy full SHA for 9d1d50a
src/Engine/Decoder.php
@@ -89,7 +89,7 @@ private function processChar(): void
89
private function readInteger(string $delimiter): string|false
90
{
91
$pos = ftell($this->stream);
92
- $readLength = 64;
+ $readLength = 32; // More than enough for 64 bit int (19 digits + minus + delimiter)
93
94
do {
95
fseek($this->stream, $pos, SEEK_SET);
@@ -104,7 +104,8 @@ private function readInteger(string $delimiter): string|false
104
return $int;
105
}
106
107
- $readLength *= $readLength; // grow exponentially
+ fread($this->stream, 1); // trigger feof
108
+ $readLength *= 32; // grow exponentially
109
} while (!feof($this->stream) && $readLength < PHP_INT_MAX);
110
111
return false;
0 commit comments