You are here

public function ctools_math_expr_stack::pop in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 includes/math-expr.inc \ctools_math_expr_stack::pop()

Remove the most recently pushed value and return it.

Return value

mixed|null The most recently pushed value, or NULL if the stack was empty.

File

includes/math-expr.inc, line 857
=============================================================================.

Class

ctools_math_expr_stack
Class implementing a simple stack structure, used by ctools_math_expr.

Code

public function pop() {
  if ($this->count > 0) {
    $this->count--;
    return $this->stack[$this->count];
  }
  return NULL;
}