PHP | Ds\Deque isEmpty() Function Last Updated : 14 Aug, 2019 Comments Improve Suggest changes Like Article Like Report 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. Below programs illustrate the Ds\Deque::isEmpty() function in PHP: Program 1: PHP <?php // Declare a deque $deck = new \Ds\Deque([1, 2, 3, 4, 5, 6]); echo("Original Deque\n"); // Display the Deque elements print_r($deck); // Use isEmpty() function to check // the deque is empty or not var_dump($deck->isEmpty()); ?> Output: Original Deque Ds\Deque Object ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 ) bool(false) Program 2: PHP <?php // Declare a deque $deck = new \Ds\Deque([1, 2, 3, 4, 5, 6]); echo("Original Deque\n"); // Display the Deque elements print_r($deck); // Clearing the Deque $deck->clear(); // Use isEmpty() function to check // the deque is empty or not var_dump($deck->isEmpty()); ?> Output: Original Deque Ds\Deque Object ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 ) bool(true) Reference: http://php.net/manual/en/ds-deque.isempty.php Comment More infoAdvertise with us Next Article PHP DsQueue isEmpty() Function B barykrg Follow Improve Article Tags : Web Technologies PHP PHP-function Similar Reads 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 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 DsSet isEmpty() Function The Ds\Set::isEmpty() function of Ds\Set class in PHP is an inbuilt function which is used to check whether a set is empty or not. If the Set instance is empty then this function returns true otherwise it returns False. Syntax: bool public Ds\Set::isEmpty ( void ) Parameters: This function does not 1 min read PHP | DsDeque insert() Function The Ds\Deque::insert() function is an inbuilt function in PHP which is used to insert the value at the given index in the Deque. Syntax: public Ds\Deque::insert( $index, $values ) : void Parameters: This function accepts two parameter as mentioned above and described below: $index: This parameter ho 2 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 | 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 Like