From c4f6bc09ac9ee2086587a330255560f07737ef5d Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Thu, 11 Jan 2024 14:56:00 +0100 Subject: [PATCH] Return immediately if limit is negative --- src/Console.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Console.php b/src/Console.php index a94410b..ab7781c 100644 --- a/src/Console.php +++ b/src/Console.php @@ -64,6 +64,9 @@ abstract class Console extends Command { $ini = trim(ini_get('memory_limit')); $limit = (int) $ini; + if ($limit < 0) { + return -1; + } $unit = strtolower($ini[strlen($ini)-1]); switch($unit) { case 'g': @@ -73,9 +76,6 @@ abstract class Console extends Command case 'k': $limit *= 1024; } - if ($limit < 0) { - return -1; - } return $limit; }