The Ds\Queue::copy() Function in PHP is used to create a shallow copy of a particular Queue instance. This function does not affect the existing Queue instance, it just creates a shallow copy of the Queue and returns it.
Ds\Queue public Ds\Queue::copy ( void )
Parameters: This function does not accepts any parameters.
Return Value: This function creates a shallow copy of an existing Queue instance and returns it.
Below programs illustrate the Ds\Queue::copy() Function in PHP:
Ds\Queue Object (  => One  => Two  => Three )
Ds\Queue Object (  => Geeks  => for  => 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.