We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2d806cc commit e84f4cbCopy full SHA for e84f4cb
expression.php
@@ -171,6 +171,9 @@ public function e($expr)
171
*/
172
public function evaluate($expr)
173
{
174
+ if (empty($expr)) {
175
+ return false;
176
+ }
177
$this->_functions = array_merge($this->_functions, $this->functions);
178
$this->last_error = null;
179
$expr = preg_replace("/\r|\n/", '', trim($expr));
tests/Expression.php
@@ -27,6 +27,7 @@ public function testEmptyFormula()
27
$expr = new Expression();
28
$expr->suppress_errors = true;
29
$this->assertEquals($expr->evaluate(''), false);
30
+ $this->assertEmpty($expr->last_error);
31
}
32
33
// -------------------------------------------------------------------------
0 commit comments