SplDoublyLinkedList::isEmpty

(PHP 5 >= 5.3.0)

SplDoublyLinkedList::isEmptyChecks whether the doubly linked list is empty.

Description

public bool SplDoublyLinkedList::isEmpty ( void )

Parameters

This function has no parameters.

Return Values

Returns whether the doubly linked list is empty.

Коментарии

//isEmpty is a method of SplDoublyLinkedList 

$obj = new SplDoublyLinkedList();
// Check wither linked list is empty
if ($obj->isEmpty())
{
    $obj->push(2);
    $obj->unshift(10);
}
print_r($obj);

//Output like this
SplDoublyLinkedList Object
(
    [flags:SplDoublyLinkedList:private] => 0
    [dllist:SplDoublyLinkedList:private] => Array
        (
            [0] => 10
            [1] => 2
        )

)
2017-07-10 10:53:48
http://php5.kiev.ua/manual/ru/spldoublylinkedlist.isempty.html

    Поддержать сайт на родительском проекте КГБ