PHPackages                             wosiwo/alinq - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. wosiwo/alinq

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

wosiwo/alinq
============

a implementation of linq to array

3101PHP

Since Nov 23Pushed 11y ago1 watchersCompare

[ Source](https://github.com/wosiwo/alinq)[ Packagist](https://packagist.org/packages/wosiwo/alinq)[ RSS](/packages/wosiwo-alinq/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

alinq
=====

[](#alinq)

a branche of the libarary Plinq() which is a implementation of linq to array.
基于Plinq() 修改的一个以linq方式操作数组的php类. ##The Purpose of Branche This branche of the libaray trying to implemente the same feature without using SPL RecursiveArrayIterator;
这个分支试图在不依赖SPL RecursiveArrayIterator 这个标准库的情况下,实现与原Plinq同样的功能

\##Differences

- This branche add a new method Instance to Instance the Alinq class without using "new" keyword. Sometimes it's usefull,like the libaray live on a framework.
    Here giving a example: 这个分支添加了一个新的方法：Instance,以传入的数组来实例化Alinq类，而不必使用new 关键字.
    这在某些情况下还是有点用的,比如在框架代码中调用这个类的时候。
    下面给出例子:

```
include('Alinq.php');

$alinq = new Alinq($array);
$otherAlinq = $alinq->Instance($newArray);

```

- Another difference is that some result of the this library are objects which could not used as array . The result object should call it's ToArray method to get array result.
    另外一个不同之处在与类库返回的结果,这个分支返回的对象结果不能直接作为数组使用,对象结果可以通过调用自身的ToArray方法来的到数组结果。 example:

```
include('Alinq.php');

$alinq = new Alinq($array);
$result = $alinq->Select(function($k, $v){ return $v['int']; })->ToArray();
```

Alinq methods that will return object:
--------------------------------------

[](#alinq-methods-that-will-return-object)

- `Instance()`
- `Single()`
- `GroupBy()`
- `Concat()`
- `SelectMany()`
- `Select()`
- `Where()`
- `Skip()`
- `Take()`
- `All()`
- `Any()`
- `Average()`
- `OrderBy()`
- `OrderByDescending()`
- `Max()`
- `Min()`
- `count()`
- `Distinct()`
- `Intersect()`
- `Diff()`
- `ElementAt()`
- `First()`
- `Last()`
- `Array2DInverse()`
- `ToArray()`

Requirements
------------

[](#requirements)

- PHP 5.3 or higher -- because of it depends on the new feature closures in PHP 5.3

Usage
-----

[](#usage)

```
include('Alinq.php');
$p = new Plinq($testArray);
$result = $p->Where(function($k, $v){ return ($v['int'] > 998); })->ToArray();
```

\##Running tests install phpunit

```
wget https://phar.phpunit.de/phpunit.phar
chmod +x phpunit.phar
sudo mv phpunit.phar /usr/local/bin/phpunit
```

run phpunit

```
phpunit --verbose test/AlinqTest.php
```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/8636e9c162a8cf8171bfc7faf74eea9f0a368af7f526db3dbd9bf85066d53509?d=identicon)[onceme](/maintainers/onceme)

---

Top Contributors

[![wosiwo](https://avatars.githubusercontent.com/u/6309351?v=4)](https://github.com/wosiwo "wosiwo (23 commits)")

### Embed Badge

![Health badge](/badges/wosiwo-alinq/health.svg)

```
[![Health](https://phpackages.com/badges/wosiwo-alinq/health.svg)](https://phpackages.com/packages/wosiwo-alinq)
```

###  Alternatives

[vitalets/x-editable

In-place editing with Twitter Bootstrap, jQuery UI or pure jQuery.

6.5k18.6k1](/packages/vitalets-x-editable)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
