PHP | Ds\Deque 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.
Below programs illustrate the Ds\Deque::isEmpty() function in PHP:
Program 1:
<?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()); ?> |
Original Deque
Ds\Deque Object
(
[0] => 1
[1] => 2
[2] => 3
[3] => 4
[4] => 5
[5] => 6
)
bool(false)
Program 2:
<?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()); ?> |
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
Recommended Posts:
- PHP | Ds\Map isEmpty() Function
- PHP Ds\Set isEmpty() Function
- PHP Ds\Queue isEmpty() Function
- PHP | SplDoublyLinkedList isEmpty() Function
- PHP Ds\PriorityQueue isEmpty() Function
- PHP | Ds\Collection isEmpty() Function
- PHP | Ds\Vector isEmpty() Function
- PHP | Ds\Stack isEmpty() Function
- Underscore.js | _.isEmpty()
- How to call a function that return another function in JavaScript ?
- How to get the function name from within that function using JavaScript ?
- D3.js | d3.rgb() Function
- CSS | hsl() Function
- PHP | max( ) Function
- p5.js | hex() function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.



