From 38d1abc13a470fbadc765b88155d86ac05e1a53f Mon Sep 17 00:00:00 2001 From: Bruce Weirdan Date: Fri, 24 Feb 2023 20:38:15 -0400 Subject: [PATCH] Don't crash on empty `jit_buffer_size` Fixes vimeo/psalm#9396 --- src/Psalm/Internal/Fork/PsalmRestarter.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Psalm/Internal/Fork/PsalmRestarter.php b/src/Psalm/Internal/Fork/PsalmRestarter.php index 589c354ca..32c255ca2 100644 --- a/src/Psalm/Internal/Fork/PsalmRestarter.php +++ b/src/Psalm/Internal/Fork/PsalmRestarter.php @@ -87,6 +87,10 @@ class PsalmRestarter extends XdebugHandler private static function toBytes(string $value): int { + if (strlen($value) === 0) { + return 0; + } + $unit = strtolower($value[strlen($value) - 1]); if (in_array($unit, ['g', 'm', 'k'], true)) {