SplDoublyLinkedList
在线手册:中文 英文
PHP手册

SplDoublyLinkedList::bottom

(PHP 5 >= 5.3.0)

SplDoublyLinkedList::bottomPeeks at the node from the beginning of the doubly linked list

说明

mixed SplDoublyLinkedList::bottom ( void )

参数

此函数没有参数。

返回值

The value of the first node.

错误/异常

Throws RuntimeException when the data-structure is empty.


SplDoublyLinkedList
在线手册:中文 英文
PHP手册
PHP手册 - N: Peeks at the node from the beginning of the doubly linked list

用户评论:

rakesh dot mishra at gmail dot com (27-Jan-2011 06:39)

<?php

/*
 * Examples of DoublyLinkedList
 */

$obj = new SplDoublyLinkedList();

// Check wither linked list is empty
if ($obj->isEmpty())
{
    echo
"Adding nodes to Linked List<br>";
   
$obj->push(2);
   
$obj->push(3);
   
    echo
"Adding the node at beginning of doubly linked list <br>";
   
$obj->unshift(10);
}

echo
"<br>Our Linked List:";
print_r($obj);

echo
"<br>Pick the node from beginning of doubly linked list";
echo
$obj->bottom();

?>