From 6604508a998ea44f4e8ddfc568db83d0e27a53af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20L=C3=BCck?= Date: Sat, 11 Jan 2020 18:11:46 +0100 Subject: [PATCH] Avoid unneeded warning when decoding invalid data on PHP 7.4 --- .travis.yml | 2 ++ src/ChunkedStreamDecoder.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 46a0486..2715358 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ php: - 7.0 - 7.1 - 7.2 + - 7.3 + - 7.4 - nightly # ignore errors, see below - hhvm # ignore errors, see below diff --git a/src/ChunkedStreamDecoder.php b/src/ChunkedStreamDecoder.php index a96592e..fc76d52 100644 --- a/src/ChunkedStreamDecoder.php +++ b/src/ChunkedStreamDecoder.php @@ -111,7 +111,7 @@ protected function iterateBuffer() } } $this->nextChunkIsLength = false; - if (dechex(hexdec($lengthChunk)) !== strtolower($lengthChunk)) { + if (dechex(@hexdec($lengthChunk)) !== strtolower($lengthChunk)) { $this->emit('error', array( new Exception('Unable to validate "' . $lengthChunk . '" as chunk length header'), ));