PHP - Fonction Ds \ Stack :: copy ()

La fonction Ds \ Stack :: copy () peut retourner une copie superficielle de la pile.

Syntaxe

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

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

Exemple

<?php 
   $stack = new \Ds\Stack(); 
  
   $stack->push("Tutorials"); 
   $stack->push("Point"); 
   $stack->push("India"); 
  
   print_r($stack->copy()); 
?>