PHP | Ds\Sequence pop() Function Last Updated : 24 Jan, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The Ds\Sequence::pop() function is an inbuilt function in PHP which removes the last value from sequence and return it. Syntax: abstract public Ds\Sequence::pop( void ) : mixed Parameters: This function does not accept any parameter. Return Value: This function returns the popped value. Below programs illustrate the Ds\Sequence::pop() function in PHP: Program 1: php <?php // Create new sequence $seq = new \Ds\Vector( [12, 15, 18, 20] ); // pop the sequence element var_dump($seq->pop()); // pop the sequence element var_dump($seq->pop()); // pop the sequence element var_dump($seq->pop()); // pop the sequence element var_dump($seq->pop()); ?> Output: int(20) int(18) int(15) int(12) Program 2: php <?php // Create new sequence $seq = new \Ds\Vector([12, 15, 18, 20]); for ($i = 0; $i < 4; $i++) { // Pop the sequence element var_dump($seq->pop()); } ?> Output: int(20) int(18) int(15) int(12) Reference: http://php.net/manual/en/ds-sequence.pop.php Comment More infoAdvertise with us Next Article PHP | DsStack pop() Function V vijay_raj Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-DS\Collection Similar Reads PHP | DsDeque pop() Function The Ds\Deque::pop() function is an inbuilt function in PHP which is used to remove the last element from Deque (if Deque is not empty) and return it. If Deque is empty then it throws an exception. Syntax: public Ds\Deque::pop( void ) : mixed Parameters: This function does not accept any parameter. R 2 min read PHP | DsStack pop() Function The Ds\Stack::pop() function of PHP is used to remove the element present at the top of the Stack instance. This function also returns the top element of the stack after removing it. Syntax: mixed public Ds\Stack::pop ( void ) Parameters: This function does not accept any parameters.Return Value mix 2 min read PHP DsQueue pop() Function The Ds\Queue::pop() Function in PHP is used to remove and return the value present at the top of the Queue. In other words, it returns the value present at the front of the Queue and also removes it from the Queue. Syntax: mixed public Ds\Queue::pop ( void ) Parameters: This function does not accept 2 min read PHP pos() Function The pos() is an inbuilt function in PHP which is used to return the value of the element in an array which the internal pointer is currently pointing to. The pos() function does not increment or decrement the internal pointer after returning the value. In PHP all arrays have an internal pointer. Thi 2 min read PHP | DsSet slice() Function The Ds\Set::slice() function is an inbuilt function in PHP which is used to return the sub-set of given range. Syntax: Ds\Set public Ds\Set::slice ( int $index [, int $length ] ) Parameters: This function accepts two parameters as mentioned above and described below: $index: This parameter holds the 2 min read PHP | DsVector pop() Function The Ds\Vector::pop() function is an inbuilt function in PHP which is used to remove the last element of a vector and return it. Syntax: mixed public Ds\Vector::pop( void ) Parameters: This function does not accept any parameter. Return Value: This function returns the last element which removed from 2 min read Like