public function pop() {
    $items = $this->getItems();
    if ($items->isEmpty()) {
      return NULL;
    }
    if (count($items) === 1) {
      $pop_item = $items[0];
      $pop_item->remove();
      return $pop_item;
    }
    $pop_item = $items[count($items) - 1];
    $pop_item->previousUntil(function ($node) {
      if ($node instanceof HiddenNode) {
        return FALSE;
      }
      if ($node instanceof TokenNode && $node->getType() === ',') {
        return FALSE;
      }
      return TRUE;
    })->remove();
    $pop_item->remove();
    return $pop_item;
  }
public function pop() {
    $items = $this->getItems();
    if ($items->isEmpty()) {
      return NULL;
    }
    if (count($items) === 1) {
      $pop_item = $items[0];
      $pop_item->remove();
      return $pop_item;
    }
    $pop_item = $items[count($items) - 1];
    $pop_item->previousUntil(function ($node) {
      if ($node instanceof HiddenNode) {
        return FALSE;
      }
      if ($node instanceof TokenNode && $node->getType() === ',') {
        return FALSE;
      }
      return TRUE;
    })->remove();
    $pop_item->remove();
    return $pop_item;
  }
public function pop ( ) { $ items = $ this -> getItems ( ) ; if ( $ items -> isEmpty ( ) ) { return NULL ; } if ( count ( $ items ) === 1 ) { $ pop_item = $ items [ 0 ] ; $ pop_item -> remove ( ) ; return $ pop_item ; } $ pop_item = $ items [ count ( $ items ) - 1 ] ; $ pop_item -> previousUntil ( function ( $ node ) { if ( $ node instanceof HiddenNode ) { return FALSE ; } if ( $ node instanceof TokenNode && $ node -> getType ( ) === ',' ) { return FALSE ; } return TRUE ; } ) -> remove ( ) ; $ pop_item -> remove ( ) ; return $ pop_item ; }
Pop an item off end of the list.

@return Node
The removed item. NULL if item list is empty.
Pop an item off end of the list .