The Ds\Deque::first() function is an inbuilt function in PHP which returns the first value in the Deque if Deque is not empty.
public Ds\Deque::first( void ) : mixed
Parameters: This function does not accept any parameter.
Return Value: This function returns the first element from the Deque, if the deque is not empty.
Below programs illustrate the Ds\Deque::first() function in PHP:
Elements in the Deque Ds\Deque Object (  => 10  => 20  => 3  => 40  => 50  => 6 ) First element in the deque: int(10)
Elements in the Deque Ds\Deque Object (  => Geeks  => for  => GFG ) First element in the deque: string(5) "Geeks"
- Difference between :first-child and :first-of-type selector in CSS
- How to merge the first index of an array with the first index of second array?
- PHP | Ds\Sequence first() Function
- PHP | Ds\Vector first() Function
- PHP | Ds\Map first() Function
- PHP | Ds\Set first() Function
- How to get the first element of an array in PHP?
- Determine the first and last iteration in a foreach loop in PHP?
- How to get first day of week in PHP?
- How to get the first word of a sentence in PHP?
- Collect.js | first() Function
- How to get the function name inside a function in PHP ?
- PHP | Get PHP configuration information using phpinfo()
- PHP | php.ini File Configuration
- How to import config.php file in a PHP script ?
- Flask - (Creating first simple application)
- Underscore.js | first() with Examples
- How to use a not:first-child selector in CSS?
- CSS | :first-child Selector
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. 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.