The Ds\Map::first() function of PHP Ds\Map class is used to get the first key-value pair from the Map instance.
Ds\Pair public Ds\Map::first ( )
Parameters: This function does not accepts any parameter.
Return value: It returns a pair of type Ds\Pair which is the first key-value pair from the Map instance. That is the key-value pair present at the front of the Map instance.
Below programs illustrate the Ds\Map::first() function in PHP:
Ds\Pair Object ( [key] => 1 [value] => Geeks )
Ds\Pair Object ( [key] => first [value] => Geeks )
- 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\Deque first() Function
- PHP | Ds\Set first() Function
- How to get the first element of an array in PHP?
- How to remove the first character of string 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?
- How to get the function name inside a function in PHP ?
- PHP 5 vs PHP 7
- PHP | Get PHP configuration information using phpinfo()
- PHP | php.ini File Configuration
- How to import config.php file in a PHP script ?
- Step by step guide to make your first Wordpress Plugin
- PHP | imagecreatetruecolor() Function
- PHP | fpassthru( ) Function
- PHP | ImagickDraw getTextAlignment() Function
- PHP | Ds\Sequence last() 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 firstname.lastname@example.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.