The Ds\Sequence::last() function is an inbuilt function in PHP which is used to return the last element from the sequence.
mixed abstract public Ds\Sequence::last( void )
Parameters: This function does not accept any parameters.
Return value: This function returns the last element from the sequence.
Below programs illustrate the Ds\Sequence::last() function in PHP:
int(25) string(1) "s"
string(1) "x" 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.