dismiss Step into the future! Click here to switch to the beta php.net site
downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

SplDoublyLinkedList::bottom> <Datastructures
[edit] Last updated: Fri, 28 Jun 2013

view this page in

The SplDoublyLinkedList class

(PHP 5 >= 5.3.0)

Introduction

The SplDoublyLinkedList class provides the main functionalities of a doubly linked list.

Class synopsis

SplDoublyLinkedList implements Iterator , ArrayAccess , Countable {
/* Methods */
public __construct ( void )
public mixed bottom ( void )
public int count ( void )
public mixed current ( void )
public int getIteratorMode ( void )
public bool isEmpty ( void )
public mixed key ( void )
public void next ( void )
public bool offsetExists ( mixed $index )
public mixed offsetGet ( mixed $index )
public void offsetSet ( mixed $index , mixed $newval )
public void offsetUnset ( mixed $index )
public mixed pop ( void )
public void prev ( void )
public void push ( mixed $value )
public void rewind ( void )
public string serialize ( void )
public void setIteratorMode ( int $mode )
public mixed shift ( void )
public mixed top ( void )
public void unserialize ( string $serialized )
public void unshift ( mixed $value )
public bool valid ( void )
}

Table of Contents



add a note add a note User Contributed Notes SplDoublyLinkedList - [1 notes]
up
-10
rakesh dot mishra at gmail dot com
2 years ago
Here is simple examples of SplQueue: -
<?php
echo "Create Object of Spl. Queue:";
$obj = new SplQueue();

echo
"<br>Check for Queue is Empty:";
if(
$obj->isEmpty())
{
   
$obj->enqueue("Simple");
   
$obj->enqueue("Example");
   
$obj->enqueue("Of");
   
$obj->enqueue("PHP");
}

echo
"<br>View queue:";
print_r($obj);

if(!
$obj->offsetExists(4))
{
   
$obj->enqueue(10);
}

print_r($obj);

echo
"<br>Get the value of the offset at 3 ";
if(
$obj->offsetGet(3))
{
    echo
$obj->offsetGet(3);
   
    echo
"<br>Resetting the value of a node:";
   
$obj->offsetSet(4,6);
}
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites