The SplHeap::current() function is an inbuilt function in PHP which is used to get the current element pointed by the iterator.
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 same property must be recursively true for all sub-trees in that Binary Tree.
- Min-Heap: In a Min-Heap the key present at the root node must be minimum among the keys present at all of its children. The same property must be recursively true for all sub-trees in that Binary Tree.
Note: This article uses Max Heap which extends the SplHeap class.
Parameters: This function does not accept any parameter.
Return Value: This function returns current node of heap data structure.
Below programs illustrate the SplMaxHeap::current() function in PHP:
gfg GEEKS DSA C ALGO
- PHP | SplHeap count() Function
- PHP | current() Function
- How to get current function name in PHP?
- PHP | SplFileObject current( ) Function
- PHP | Imagick current() Function
- PHP | SplObjectStorage current() Function
- PHP | SplDoublyLinkedList current() Function
- PHP | SplFixedArray current() Function
- PHP | SimpleXMLIterator current() Function
- Get the current URL using jQuery?
- How to get the current date and time in seconds?
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.