PHP Ds\Set isEmpty() Function Last Updated : 16 Aug, 2019 Comments Improve Suggest changes Like Article Like Report 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 accepts any parameters. Return Value: This function returns a boolean value depending on whether the Set is empty or not. If the Set instance is empty then this function returns true otherwise it returns False. Below programs illustrate the Ds\Set::isEmpty() function: Program 1: php <?php // Declare new Set $set = new \Ds\Set(); // Display the Set element var_dump($set); // Check if set is empty if($set->isEmpty()) echo "Set is Empty"; ?> Output: object(Ds\Set)#1 (0) { } Set is Empty Program 2: php <?php // Declare new Set $set = new \Ds\Set(["Geeks", "for", "Keegs"]); // Display the Set element var_dump($set); // Check if Set is Empty if($set->isEmpty()==0) echo "Set is Not Empty"; ?> Output: object(Ds\Set)#1 (3) { [0]=> string(5) "Geeks" [1]=> string(3) "for" [2]=> string(5) "Keegs" } Set is Not Empty Reference: http://php.net/manual/en/ds-set.isempty.php Comment More infoAdvertise with us Next Article PHP | DsStack isEmpty() Function gopaldave Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-ds_set 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 | 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 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 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 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 PHP isset() Function The isset() function in PHP checks whether a variable is declared and not NULL. It returns true if the variable exists and has a non-NULL value, and false otherwise, without modifying the variable. Syntaxbool isset( mixed $var [, mixed $... ] )Parameters: This function accept one or more parameter a 3 min read PHP | is_dir( ) Function The is_dir() function in PHP used to check whether the specified file is a directory or not. The name of the file is sent as a parameter to the is_dir() function and it returns True if the file is a directory else it returns False. Syntax: is_dir($file) Parameters Used: The is_dir() function in PHP 1 min read PHP DsPriorityQueue isEmpty() Function The isEmpty() Function of Ds\PriorityQueue class in PHP is used to whether a particular PriorityQueue instance is empty or not. It returns True if the PriorityQueue is empty otherwise it returns False. Syntax: bool isEmpty( ) Parameters: This function does not accepts any parameters. Return Value: T 1 min read Like