//isEmpty is a method of SplDoublyLinkedList $obj = new SplDoublyLinkedList();// Check wither linked list is emptyif ($obj->isEmpty()){ $obj->push(2); $obj->unshift(10);}print_r($obj);//Output like thisSplDoublyLinkedList Object( [flags:SplDoublyLinkedList:private] => 0 [dllist:SplDoublyLinkedList:private] => Array ( [0] => 10 [1] => 2 ))