Open In App

PHP | Ds\Sequence shift() Function

Last Updated : 22 Aug, 2019
Comments
Improve
Suggest changes
Like Article
Like
Report
The Ds\Sequence::shift() function is an inbuilt function in PHP which is used to removes the first element from the sequence and return it. Syntax:
mixed abstract public Ds\Sequence::shift ( void )
Parameters: This function does not accepts any parameter. Return values: This function returns the first value which is removed from the sequence. Below programs illustrate the Ds\Sequence::shift() function in PHP: Program 1:
Output:
int(9)
int(10)
int(15)
int(20)
Program 2:
Output:
string(5) "Geeks"
string(3) "for"
string(5) "Geeks"
Reference: http://php.net/manual/en/ds-sequence.shift.php

Next Article

Similar Reads