From b9f72a001bca4772a003248595ad20b13a5b2277 Mon Sep 17 00:00:00 2001 From: Bruce Wells Date: Wed, 24 Oct 2018 14:16:11 -0400 Subject: Additional validation for bad expressions (*+ for example) --- src/NXP/Classes/Calculator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/NXP/Classes/Calculator.php') diff --git a/src/NXP/Classes/Calculator.php b/src/NXP/Classes/Calculator.php index bfa7015..253e70c 100644 --- a/src/NXP/Classes/Calculator.php +++ b/src/NXP/Classes/Calculator.php @@ -54,7 +54,7 @@ class Calculator } } $result = array_pop($stack); - if (!empty($stack)) { + if ($result === null || ! empty($stack)) { throw new IncorrectExpressionException(); } -- cgit v1.2.3