• PHP Video Tutorials

PHP - Ds\PriorityQueue::clear() Function



Ds\PriorityQueue::clear() function can remove all values from the queue.

Syntax

public void Ds\PriorityQueue::clear( void )

Ds\PriorityQueue::clear() function doesn't have any parameters.

Ds\PriorityQueue::clear() function doesn't return any value.

Example

<?php
   $pqueue = new \Ds\PriorityQueue();  
   $pqueue->push("Tutorials", 10); 
   $pqueue->push("Point", 20); 
   $pqueue->push("India", 30); 
  
   echo "The initial PriorityQueue is: \n"; 
   print_r($pqueue); 
  
   $pqueue->clear(); 
  
   echo "\n The PriorityQueue after clear() function: \n"; 
   print_r($pqueue); 
?>
php_function_reference.htm
Advertisements