evaluate() public method

Evaluate an expression under a given context
public evaluate ( string $expression, Context $context ) : mixed
$expression string
$context Context
return mixed
 /**
  * @test
  */
 public function loopedExpressions()
 {
     $this->markTestSkipped('Enable for benchmark');
     $evaluator = new InterpretedEvaluator();
     $expression = 'foo.bar=="Test"||foo.baz=="Test"||reverse(foo).bar=="Test"';
     $context = new Context(['foo' => ['bar' => 'Test1', 'baz' => 'Test2'], 'reverse' => function ($array) {
         return array_reverse($array, true);
     }]);
     for ($i = 0; $i < 10000; $i++) {
         $evaluator->evaluate($expression, $context);
     }
 }