public final function execute(OperandStack $values) { $rhs = $values->peek(); $values->pop(); $lhs = $values->peek(); $result = $this->executeImplementation($lhs, $rhs); $values->replaceTop($result); }
public function execute(OperandStack $values) { $operand = $values->peek(); $result = 1; while ($operand > 0) { $result *= $operand; $operand -= 1; } $values->replaceTop($result); }