var_dump($exp->toInfix());
var_dump($result);
ExpressionEngine\ExpressionEngine::bind(array("domain" => 'dreamnex.com', 'user' => 'support'));
$result = $exp->evaluate();
var_dump($exp->toInfix());
var_dump($result);
// By user (multiple choice)
$userValues = array('contact', 'support', 'abuse', 'webmaster');
$userExpression1 = new EqExpression(new ConstantExpression($userValues[0]), new VariableExpression('user'));
$userExpression2 = new EqExpression(new ConstantExpression($userValues[1]), new VariableExpression('user'));
$exp = new OrExpression($userExpression1, $userExpression2);
foreach (array_slice($userValues, 2) as $user) {
    $userExpression = new EqExpression(new ConstantExpression($user), new VariableExpression('user'));
    $exp = new OrExpression($exp, $userExpression);
}
var_dump($exp->toInfix());
ExpressionEngine\ExpressionEngine::bind(array('user' => 'contact'));
$result = $exp->evaluate();
var_dump($result);
ExpressionEngine\ExpressionEngine::bind(array('user' => 'support'));
$result = $exp->evaluate();
var_dump($result);
ExpressionEngine\ExpressionEngine::bind(array('user' => 'abuse'));
$result = $exp->evaluate();
var_dump($result);
ExpressionEngine\ExpressionEngine::bind(array('user' => 'webmaster'));
$result = $exp->evaluate();
var_dump($result);
ExpressionEngine\ExpressionEngine::bind(array('user' => 'blabla'));
$result = $exp->evaluate();
var_dump($result);
<?php

// http://docs.limesurvey.org/tiki-index.php?page=Expression+Engine+for+Conditions
include '../lib/ExpressionEngine.class.php';
use org\limesurvey\ExpressionEngine;
use org\limesurvey\ExpressionEngine\base\ConstantExpression;
use org\limesurvey\ExpressionEngine\logic\LeqExpression;
use org\limesurvey\ExpressionEngine\math\AddExpression;
$exp = ExpressionEngine\ExpressionEngine::create("1 1 + 2 ==");
$result = $exp->evaluate();
var_dump($result);
$exp = new LeqExpression(new ConstantExpression(12), new AddExpression(new ConstantExpression(10), new ConstantExpression(3)));
$result = $exp->evaluate();
var_dump($result);
var_dump($exp->toPostfix());
var_dump($exp->toInfix());
$exp = ExpressionEngine\ExpressionEngine::create("6 7 + 11 * @a sqr <");
ExpressionEngine\ExpressionEngine::bind(array("a" => 12));
$result = $exp->evaluate();
var_dump($result);
// Returns TRUE
ExpressionEngine\ExpressionEngine::bind(array("a" => 11));
$result = $exp->evaluate();
var_dump($result);
// Returns FALSE
 public function evaluate()
 {
     return ExpressionEngine\ExpressionEngine::getVar($this->name);
 }