public function execute(array $arguments, RussellInterpreter\Interpreter $core) { $condition = $arguments[0]; $consequent = $arguments[1]; $alternative = isset($arguments[2]) ? $arguments[2] : false; if ($core->calculation($condition)) { return $core->calculation($consequent); } elseif ($alternative) { return $core->calculation($alternative); } return null; }
public function execute(array $arguments, RussellInterpreter\Interpreter $core) { $value = $arguments[0]; if (is_array($value)) { $name = $value['name']; $value = $core->getVariable($name, 0); $value--; $core->setVariable($name, $value); } else { if (!is_numeric($arguments[0])) { $value = $core->calculation($arguments[0]); } $value--; } return $value; }
public function execute(array $arguments, RussellInterpreter\Interpreter $core) { // $name = trim($arguments[0], '\'"'); $core->setVariable($arguments[0], $arguments[1]); }
public function init(RussellInterpreter\Interpreter $core) { $core->setVariable('false', false); }
public function init(RussellInterpreter\Interpreter $core) { $core->setVariable('true', true); }