The Ds\Sequence::first() function is an inbuilt function in PHP which is used to return the first element from the sequence.
mixed abstract public Ds\Sequence::first ( void )
Parameter: This function does not accepts any parameter.
Return value: This function returns the first element from the sequence.
Below programs illustrate the Ds\Sequence::first() function in PHP:
int(10) string(1) "G"
int(21) string(1) "G"
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.