PHPackages                             hkvstore/pinq - 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. hkvstore/pinq

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

hkvstore/pinq
=============

PHP Integrated Query - A real LINQ library for PHP

v3.5.1(3y ago)018.4k↑50%1MITPHPPHP &gt;=7.4.0

Since Jan 7Pushed 3y agoCompare

[ Source](https://github.com/hkvstore/Pinq)[ Packagist](https://packagist.org/packages/hkvstore/pinq)[ Docs](http://www.github.com/TimeToogo/Pinq)[ RSS](/packages/hkvstore-pinq/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (4)Versions (2)Used By (0)

PHP Integrated Query - [Official site](http://timetoogo.github.io/Pinq/)
========================================================================

[](#php-integrated-query---official-site)

[![Build status](https://camo.githubusercontent.com/93dd6e1f60ce43b64960e7b505646d2fd14f4e6c02dbc0977623c59659ddf898/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f54696d65546f6f676f2f50696e712f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/TimeToogo/Pinq)[![Code quality](https://camo.githubusercontent.com/699c7dbd5b28dc351b97bea9cff598cb4a791df6bc526633d33bb0ad8d5972c8/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f54696d65546f6f676f2f50696e712e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/TimeToogo/Pinq)[![Coverage Status](https://camo.githubusercontent.com/16239c4da3ae5941140e80a1883059962ca7190e4c1d45436c0aa477578948d9/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f54696d65546f6f676f2f50696e712f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://coveralls.io/r/TimeToogo/Pinq?branch=master)[![Stable Release](https://camo.githubusercontent.com/448a14e63782b84ee33759e629918875bbd781e538908a5a7f3dbb03f56e0059/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f54696d65546f6f676f2f50696e712e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/timetoogo/pinq)[![License](https://camo.githubusercontent.com/a6aaad164457238c3c6112d7258e288564001b0b32f7c3b1cf4cfe8b296d68d6/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f54696d65546f6f676f2f50696e712e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/timetoogo/pinq)

What is PINQ?
=============

[](#what-is-pinq)

Based off the .NET's [LINQ (Language integrated query)](http://msdn.microsoft.com/en-us/library/bb397926.aspx), PINQ unifies querying across [arrays/iterators](http://timetoogo.github.io/Pinq/examples.html) and [external data sources](http://timetoogo.github.io/Pinq/query-provider.html), in a single readable and concise [fluent API](http://timetoogo.github.io/Pinq/api.html).

An example
==========

[](#an-example)

```
$youngPeopleDetails = $people
        ->where(function ($row) { return $row['age'] orderByAscending(function ($row) { return $row['firstName']; })
        ->thenByAscending(function ($row) { return $row['lastName']; })
        ->take(50)
        ->indexBy(function ($row) { return $row['phoneNumber']; })
        ->select(function ($row) {
            return [
                'fullName'    => $row['firstName'] . ' ' . $row['lastName'],
                'address'     => $row['address'],
                'dateOfBirth' => $row['dateOfBirth'],
            ];
        });
```

[More examples](http://timetoogo.github.io/Pinq/examples.html)

Installation
============

[](#installation)

PINQ is compatible with &gt;= PHP 7.3

Install the package via composer:

```
composer require timetoogo/pinq

```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 96.6% 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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

1218d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6fc3d3f9a4c5f6cba9ff19b64c2e628147bd91a391b81021d94c0908754330af?d=identicon)[hkvstore](/maintainers/hkvstore)

---

Top Contributors

[![TimeToogo](https://avatars.githubusercontent.com/u/689898?v=4)](https://github.com/TimeToogo "TimeToogo (56 commits)")[![giorrrgio](https://avatars.githubusercontent.com/u/482501?v=4)](https://github.com/giorrrgio "giorrrgio (1 commits)")[![hkvstore](https://avatars.githubusercontent.com/u/16445695?v=4)](https://github.com/hkvstore "hkvstore (1 commits)")

---

Tags

querycollectionpinq

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hkvstore-pinq/health.svg)

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

###  Alternatives

[phpcollection/phpcollection

General-Purpose Collection Library for PHP

1.0k64.0M34](/packages/phpcollection-phpcollection)[athari/yalinqo

YaLinqo, a LINQ-to-objects library for PHP

4561.2M5](/packages/athari-yalinqo)[league/uri-components

URI components manipulation library

31932.3M66](/packages/league-uri-components)[league/period

Time range API for PHP

7335.4M21](/packages/league-period)[lorisleiva/lody

Load files and classes as lazy collections in Laravel.

956.6M9](/packages/lorisleiva-lody)[chdemko/sorted-collections

Sorted Collections for PHP &gt;= 8.2

222.5M3](/packages/chdemko-sorted-collections)

PHPackages © 2026

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