Skip to content

Commit 7e932e3

Browse files
authored
Return 0 when UInt byte is empty
addresses PHP 8.5 deprecation fixes #151
1 parent fdb0a1d commit 7e932e3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/FontLib/BinaryStream.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,11 @@ public function write($data, $length = null) {
158158
}
159159

160160
public function readUInt8() {
161-
return ord($this->read(1));
161+
$byte = $this->read(1);
162+
if ($byte === '') {
163+
return 0;
164+
}
165+
return ord($byte);
162166
}
163167

164168
public function readUInt8Many($count) {

0 commit comments

Comments
 (0)