Linked list implementation in PHP