PHP - Fonction Ds Set copy ()

La fonction Ds \ Set :: copy () peut renvoyer une copie superficielle de l'ensemble.

Syntaxe

public Ds\Set Ds\Set::copy( void )

La fonction Ds \ Set :: copy () n'a aucun paramètre.

Exemple 1

<?php  
   $set = new \Ds\Set([10, 15, 20, 25, 30]);  
   print_r($set);  
   
   $set->copy();  
   print_r($set);  
?>

Exemple-2

<?php  
   $set = new \Ds\Set(["Tutorials", "Point", "India"]);  
   print_r($set);  
    
   $set->copy();  
   print_r($set); 
?>