// isEmpty 是 SplDoublyLinkedList 的方法
$obj = new SplDoublyLinkedList();
// 检查链表是否为空
if ($obj->isEmpty())
{
$obj->push(2);
$obj->unshift(10);
}
print_r($obj);
// 输出类似于
SplDoublyLinkedList Object
(
[flags:SplDoublyLinkedList:private] => 0
[dllist:SplDoublyLinkedList:private] => Array
(
[0] => 10
[1] => 2
)
)