PHP - Função Ds Deque reverse ()

A função Ds \ Deque :: reverse () pode reverter o deque no local.

Sintaxe

public void Ds\Deque::reverse( void )

A função Ds \ Deque :: reverse () não tem parâmetros.

A função Ds \ Deque :: reverse () não retorna nenhum valor.

Exemplo 1

<?php 
   $deque = new \Ds\Deque([10, 20, 30, 40, 50]); 
   echo("The elements in deque: \n"); 
   var_dump($deque); 
   
   $deque->reverse(); 
   echo("\n The elements of reversed deque: \n"); 
   var_dump($deque);
?>

Exemplo 2

<?php 
   $deque = new \Ds\Deque(["Tutorials", "Point", "India"]); 
   echo("The elements in deque: \n"); 
   print_r($deque); 
   
   $deque->reverse(); 
   echo("\n The elements of reversed deque: \n"); 
   print_r($deque); 
?>