class Node{ public $data; public $next; }
class Test { public function HeadInsert() { // 头结点 $linkList = new Node(); $linkList->next = null; // 插入的新节点 $node = new Node(); $node->data = 'test'; $node->next = $linkList->next; $linkList->next = $node; } }