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