Skip to content

Commit 87baf57

Browse files
committed
[ExpressionLanguage][Node][BinaryNode] Process division by zero
1 parent a054d88 commit 87baf57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy