function units_mathematical_expression_postfix_stack_pop in Units of Measurement 7.2
Pop an element off a postfix parsing stack.
Parameters
array $stack: Current stack of postfix parsing
Return value
UnitsMathematicalExpression|string Popped element off the postfix parsing stack. It may be either an instance of UnitsMathematicalExpression or a string depending on what stage of parsing we are
Throws
UnitsMathematicalExpressionMalformedException Exception is thrown if the stack is empty
1 call to units_mathematical_expression_postfix_stack_pop()
- units_mathematical_expression_load in ./
units.module - Load mathematical expression from database.
File
- ./
units.module, line 807 - Provide API for managing and converting units of measurement.
Code
function units_mathematical_expression_postfix_stack_pop(&$stack) {
if (empty($stack)) {
throw new UnitsMathematicalExpressionMalformedException();
}
return array_pop($stack);
}