vpinti/sorted-linked-list
Composer 安装命令:
composer require vpinti/sorted-linked-list
包简介
A blazing fast, type-safe sorted linked list library for PHP. Supports automatic sorting, integer and string values, and modern PHP features.
README 文档
README
A blazing fast, type-safe, and fully tested sorted linked list library for PHP. Supports both integer and string values, with automatic sorting in ascending or descending order. Designed for performance, maintainability, and extensibility.
Features
- Automatic sorting (ascending/descending)
- Type safety: only one type per list (int or string)
- Fast insert, delete, contains, clear, and iteration Internal sorting logic (no external comparator needed)
- Simple, modern API
Installation
Install via Composer:
composer require vpinti/sorted-linked-list
Usage
use Vpinti\SortedLinkedList\SortedLinkedList; use Vpinti\SortedLinkedList\Enum\SortOrder; $list = new SortedLinkedList(SortOrder::ASC); $list->insert(5); $list->insert(2); $list->insert(8); $list->insert(1); // Get sorted values as array $values = $list->toArray(); // [1, 2, 5, 8] // Check if a value exists $list->contains(5); // true // Remove a value $list->delete(2); // Iterate foreach ($list as $value) { echo $value . PHP_EOL; } // Clear the list $list->clear(); // Use with strings $stringList = new SortedLinkedList(SortOrder::DESC); $stringList->insert('banana'); $stringList->insert('apple'); $stringList->insert('pear'); // $stringList->toArray(); // ['pear', 'banana', 'apple']
API
SortedLinkedList
__construct(SortOrder $order = SortOrder::ASC)insert(int|string $value): voiddelete(int|string $value): boolcontains(int|string $value): boolclear(): voidtoArray(): arraycount(): int__toString(): string- Iterator support (
foreach)
Extensibility
Sorting logic is handled internally by the SortedLinkedList class. Custom comparators are not required or supported in this version.
Contributing
Pull requests and stars are welcome! For major changes, please open an issue first to discuss what you would like to change.
License
MIT
vpinti/sorted-linked-list 适用场景与选型建议
vpinti/sorted-linked-list 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 0 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 08 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「collection」 「data structure」 「sorted」 「linked list」 「type-safe」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 vpinti/sorted-linked-list 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 vpinti/sorted-linked-list 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 vpinti/sorted-linked-list 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Shoot aims to make providing data to your templates more manageable
Adds the EDTF data type to Wikibase
A simple library that allows transform any kind of data to native php data or whatever
This package provides type-safe extension of the laravel collection, forcing a single type of object.
Traits to build collections of specific objects
Data provider for yii2
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 26
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-08-21