Linked List implementation in PHP.
composer require angle/linked
Creating an empty list and appending items.
$list = new Angle\Linked\Linked;
$list->append('PHP');
$list->append('Ruby');
$list->append('Javascript');
print $list->head->next->next->data; // Javascript
Prepend elements to the list:
$list->prepend('Golang');
print $list->head->data; // Golang
Print the list:
print $list; // Golang, PHP, Ruby, Javascript
Improvements are welcome! Feel free to submit pull requests.
MIT
Copyright ยฉ 2019 Angle Software