From cb38a4007f837943ec87fe27f8a9fed95068ba18 Mon Sep 17 00:00:00 2001 From: Victor Westerlund Date: Mon, 27 Mar 2023 18:03:48 +0200 Subject: [PATCH] fix: get flags return type (#3) --- src/FunctionFlags.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/FunctionFlags.php b/src/FunctionFlags.php index 7d7ddfa..3aa77ef 100644 --- a/src/FunctionFlags.php +++ b/src/FunctionFlags.php @@ -34,7 +34,8 @@ // Get args array from stack entry by index $args = $stack[$idx]["args"]; - return !empty($args) ? end($args) : null; + // Return null if no arguments provided or not a valid int flag + return !empty($args) && is_int(end($args)) ? end($args) : null; } /* ---- */