private function popValues(Stack $stack) { $values = array(); foreach ($stack as $value) { $values[] = $value; } return $values; }