Skip to content

Commit 55c24fc

Browse files
committed
Binary::readBool(): fixed incorrect results returned when passing a string longer than 1
1 parent dc94786 commit 55c24fc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Binary.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ private static function safeUnpack(string $formatCode, string $bytes, int $needL
104104
* Reads a byte boolean
105105
*/
106106
public static function readBool(string $b) : bool{
107-
return $b !== "\x00";
107+
return $b[0] !== "\x00";
108108
}
109109

110110
/**

0 commit comments

Comments
 (0)