angle / linked
Linked List implementation in PHP.
v1.0.0
2019-03-10 16:40 UTC
Requires
- php: ^7.0
Requires (Dev)
- phpunit/phpunit: ^8.0
- symfony/var-dumper: ^4.2
This package is auto-updated.
Last update: 2025-03-11 15:47:36 UTC
README
Linked List implementation in PHP.
Installation
composer require angle/linked
Usage
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
Contributing
Improvements are welcome! Feel free to submit pull requests.
Licence
MIT
Copyright © 2019 Angle Software