Class Expr
Factory for Webmozart\Expression\Expression
instances.
Use this class to build expressions:ons:
$expr = Expr::greaterThan(20)->orLessThan(10);
You can evaluate the expression with another value Expression::evaluate():
if ($expr->evaluate($value)) { // do something... }
You can also evaluate expressions by arrays by passing the array keys as second argument:
$expr = Expr::greaterThan(20, 'age') ->andStartsWith('Thomas', 'name'); $values = array( 'age' => 35, 'name' => 'Thomas Edison', ); if ($expr->evaluate($values)) { // do something... }
Namespace: Webmozart\Expression
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
Located at Expr.php
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
Located at Expr.php