LinkedList implementation in PHP