aboutsummaryrefslogtreecommitdiff
path: root/src/NXP/Classes/Token/TokenDivision.php
diff options
context:
space:
mode:
authorAlexander Kiryukhin <alexander@kiryukhin.su>2018-09-06 20:39:47 +0300
committerGitHub <noreply@github.com>2018-09-06 20:39:47 +0300
commit3011a1c55686ef5a0c7759ae1efcb2a71623ab9c (patch)
treec192d6dd2948e83122893ab67228141b271c2d22 /src/NXP/Classes/Token/TokenDivision.php
parent29d32a155f9956d1041a4420c19986565f695040 (diff)
parent855ca5dfc1a6d70d9872df4b0d7bea8ba3c4c040 (diff)
Merge branch 'master' into getters_for_function_and_operators
Diffstat (limited to 'src/NXP/Classes/Token/TokenDivision.php')
-rw-r--r--src/NXP/Classes/Token/TokenDivision.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/NXP/Classes/Token/TokenDivision.php b/src/NXP/Classes/Token/TokenDivision.php
index 479a4ec..f1c35ff 100644
--- a/src/NXP/Classes/Token/TokenDivision.php
+++ b/src/NXP/Classes/Token/TokenDivision.php
@@ -47,7 +47,7 @@ class TokenDivision extends AbstractOperator
{
$op2 = array_pop($stack);
$op1 = array_pop($stack);
- $result = $op1->getValue() / $op2->getValue();
+ $result = $op2->getValue() != 0 ? $op1->getValue() / $op2->getValue() : 0;
return new TokenNumber($result);
}