The Ds\Deque::get() function is an inbuilt function in PHP which is used to return the value at the given index.
public Ds\Deque::get( $index ) : mixed
Parameters: This function accepts single parameter $index which holds the index for which element is to be found.
Return Value: This function returns the value at given index.
Below programs illustrate the Ds\Deque::get() function in PHP:
Elements in the Deque Ds\Deque Object (  => 10  => 20  => 3  => 40  => 50  => 6 ) Element at index 2 in the deque: int(3)
Elements in the Deque Ds\Deque Object (  => geeks  => for  => geeks  => PHP ) Element at index 2 in the deque: string(5) "geeks"
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.