Skip to content

Commit b648e75

Browse files
committed
[ExpressionLanguage][Node][BinaryNode] Process division by zero
1 parent e28bc78 commit b648e75

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,9 @@ public function evaluate(array $functions, array $values)
147147
case '*':
148148
return $left * $right;
149149
case '/':
150+
if ($right == 0) {
151+
throw new \DivisionByZeroError('Division by zero');
152+
}
150153
return $left / $right;
151154
case '%':
152155
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