PHP - Fonction Ds Set first ()

La fonction Ds \ Set :: first () peut retourner la première valeur d'un ensemble.

Syntaxe

public void Ds\Set::first( void )

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

Exemple 1

<?php 
   $set = new \Ds\Set(); 
   $set->add("10"); 
   $set->add("20"); 
   $set->add("30"); 
  
   print_r($set->first()); 
?>

Exemple 2

<?php 
   $set = new \Ds\Set(); 
   $set->add("Tutorials"); 
   $set->add("Point"); 
   $set->add("India"); 
  
   print_r($set->first());
?>