• PHP Video Tutorials

PHP - Ds Set copy() Function



Ds\Set::copy() function can return a shallow copy of the set.

Syntax

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

Ds\Set::copy() function doesn't have any parameters.

Example 1

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

Example-2

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