PHP | Ds\Vector isEmpty() Function Last Updated : 22 Aug, 2019 Comments Improve Suggest changes Like Article Like Report 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. Below programs illustrate the Ds\Vector::isEmpty() function in PHP: Program 1: PHP <?php // Create new vector $vector = new \Ds\Vector([1, 2, 4, 5]); // Use isEmpty() function to // check vector var_dump($vector->isEmpty()); // Use clear() function to remove // vector elements $vector->clear(); // Use isEmpty() function var_dump($vector->isEmpty()); ?> Output: bool(false) bool(true) Program 2: PHP <?php // Create new vector $vector = new \Ds\Vector(["geeks", "for", "geeks"]); // Use isEmpty() function to // check vector var_dump($vector->isEmpty()); // Use clear() function to remove // vector elements $vector->clear(); // Use isEmpty() function var_dump($vector->isEmpty()); ?> Output: bool(false) bool(true) Reference: http://php.net/manual/en/ds-vector.isempty.php Comment More infoAdvertise with us Next Article PHP | DsCollection isEmpty() Function B barykrg Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_vector Similar Reads 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 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 | 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 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 | 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 | DsCollection isEmpty() Function The Ds\Collection::isEmpty() function is an inbuilt function in PHP which is used to returns whether collection is empty. Syntax: Ds\Collection::isEmpty ( void ) : bool Parameters: This function does not accepts any parameters. Return Value: It returns True if collection is empty or False otherwise. 1 min read Like