Skip to content

Commit 318b9eb

Browse files
committed
[ExpressionLanguage][Node][BinaryNode] Process division by zero
1 parent 594e7ae commit 318b9eb

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Symfony/Component/ExpressionLanguage/Node/BinaryNode.php

+4
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,10 @@ public function evaluate($functions, $values)
147147
case '*':
148148
return $left * $right;
149149
case '/':
150+
if (0 == $right) {
151+
throw new \DivisionByZeroError('Division by zero');
152+
}
153+
150154
return $left / $right;
151155
case '%':
152156
return $left % $right;

0 commit comments

Comments
 (0)