The SplDoublyLinkedList::shift() function is an inbuilt function in PHP which is used to shift the node from the beginning of the doubly linked list.
mixed SplDoublyLinkedList::shift( void )
Parameters: This function does not accepts any parameters.
Return Value: It returns the value of shifted node.
Below programs illustrate the SplDoublyLinkedList::shift() function in PHP:
int(30) int(20) int(30)
int(1) int(2) int(3) int(8)
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.