PHP - Funzione Ds Set last ()
La funzione Ds \ Set :: last () può restituire l'ultimo valore in un set.
Sintassi
public void Ds\Set::last( void )La funzione Ds \ Set :: last () non ha parametri.
La funzione Ds \ Set :: last () può restituire l'ultimo valore in un set. Questa funzione può generare UnderflowException se vuota.
Esempio 1
<?php 
   $set = new \Ds\Set(); 
   $set->add("25"); 
   $set->add("50"); 
   $set->add("75"); 
   $set->add("100"); 
   print_r($set->last()); 
?>Esempio 2
<?php 
   $set = new \Ds\Set(); 
   $set->add("Tutorials"); 
   $set->add("Point"); 
   $set->add("India"); 
  
   print_r($set->last()); 
?>