PHP Ds\Queue isEmpty() Function Last Updated : 23 Aug, 2019 Comments Improve Suggest changes Like Article Like Report The Ds\Queue::isEmpty() Function in PHP is used to whether a particular Queue instance is empty or not. It returns True if the Queue is empty otherwise it returns False. Syntax: bool public Ds\Queue::isEmpty ( void ) Parameters: This function does not accepts any parameters. Return Value: This function returns a boolean value based on whether this Queue is empty or not. It returns True if the Queue is empty otherwise it returns False. Below programs illustrate the Ds\Queue::isEmpty() Function in PHP: Program 1: php <?php // Declare new Queue $q = new \Ds\Queue(); // Initially Queue is Empty var_dump($q->isEmpty()); // Add elements to the Queue $q->push("One"); $q->push("Two"); $q->push("Three"); // Check again if the Queue // is Empty var_dump($q->isEmpty()); ?> Output: bool(true) bool(false) Program 2: php <?php // Declare new Queue $q = new \Ds\Queue(); // Initially Queue is Empty var_dump($q->isEmpty()); // Add elements to the Queue $q->push("Geeks"); $q->push("for"); $q->push("Geeks"); // Check again if the Queue // is Empty var_dump($q->isEmpty()); ?> Output: bool(true) bool(false) Reference: http://php.net/manual/en/ds-priorityqueue.isempty.php Comment More infoAdvertise with us Next Article PHP | DsStack isEmpty() Function G gopaldave Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_queue Similar Reads PHP DsQueue isEmpty() Function The Ds\Queue::isEmpty() Function in PHP is used to whether a particular Queue instance is empty or not. It returns True if the Queue is empty otherwise it returns False. Syntax: bool public Ds\Queue::isEmpty ( void ) Parameters: This function does not accepts any parameters. Return Value: This funct 1 min read PHP | DsStack isEmpty() Function The Ds\Stack::isEmpty() function of PHP Ds\Stack class is used to check whether a Stack is empty or not. This method returns a boolean value, True if the Stack is empty otherwise it returns False. Syntax: bool public Ds\Stack::isEmpty ( void ) Parameter: This function does not accept any parameters. 1 min read PHP | DsDeque isEmpty() Function The Ds\Deque::isEmpty() function is an inbuilt function in PHP which is used to check the Deque is empty or not. Syntax: public Ds\Deque::isEmpty( void ) : bool Parameters: This function does not accept any parameter. Return Value: This function returns true if the Deque is empty, else return false. 1 min read PHP SplPriorityQueue isEmpty() Function The SplPriorityQueue::isEmpty() function is an inbuilt function in PHP that is used to check whether the queue is empty or not. Syntax: bool SplPriorityQueue::isEmpty() Parameters: This function does not accept any parameter. Return Value: This function returns a boolean value either true or false d 1 min read PHP | DsVector isEmpty() Function The Ds\Vector::isEmpty() function is an inbuilt function in PHP which is used to check the vector is empty or not. Syntax: bool public Ds\Vector::isEmpty( void ) Parameters: This function does not accept any parameter. Return Value: This function returns true if the vector is empty, false otherwise. 1 min read PHP SplHeap isEmpty() Function The SplHeap::isEmpty() function is an inbuilt function in PHP which is used to check whether the heap is empty or not. Generally, the Heap Data Structure are of two types: Max-Heap: In a Max-Heap the key present at the root node must be greatest among the keys present at all of its children. The sam 2 min read Like