PHPackages                             hxtree/sumfinder - 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. hxtree/sumfinder

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

hxtree/sumfinder
================

This program allows for an integer array to be passed in and will then output all the pairs that add up to the sum.

v0.1.0(6y ago)04MITPHPCI failing

Since Feb 25Pushed 6y ago1 watchersCompare

[ Source](https://github.com/hxtree/sumfinder)[ Packagist](https://packagist.org/packages/hxtree/sumfinder)[ RSS](/packages/hxtree-sumfinder/feed)WikiDiscussions master Synced 6d ago

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

SumFinder
=========

[](#sumfinder)

***SumFinder*** accepts an array of integers and finds which operands sum equals the desired value.

[![CI](https://github.com/hxtree/sumfinder/workflows/CI/badge.svg)](https://github.com/hxtree/sumfinder/workflows/CI/badge.svg)[![Codacy Badge](https://camo.githubusercontent.com/be8649b23a640ae4a3184ff02ae5ad138b031432df12b33a2764921f9e7b78ee/68747470733a2f2f6170692e636f646163792e636f6d2f70726f6a6563742f62616467652f47726164652f3138303966656361373839613436376262303738383234306139653037353436)](https://app.codacy.com/manual/hxtree/sumfinder?utm_source=github.com&utm_medium=referral&utm_content=hxtree/sumfinder&utm_campaign=Badge_Grade_Dashboard)

Usage
-----

[](#usage)

```
require __DIR__ . '/../vendor/autoload.php';

$sum_finder = new SumFinder();
$sum_finder->setSumValue(10);
$sum_finder->setIntArray(1,1,2,4,4,5,5,5,6,7,9);

/*
 * output all pairs (includes duplicates and the reversed order pairs)
 * [1,9], [1,9], [4,6], [4,6], [5,5], [5,5], [5,5], [5,5], [5,5], [5,5]
 */
echo $sum_finder->getAllPairs() . PHP_EOL;

/*
 * output unique pairs only once (removes the duplicates but includes the reversed ordered pairs)
 * [1,9], [4,6], [5,5], [6,4], [9,1]
 */
echo $sum_finder->getUniquePairs() . PHP_EOL;

/*
 * output the same combo pair only once (removes the reversed ordered pairs)
 * [1,9], [4,6], [5,5]
 */
echo $sum_finder->getComboPairs() . PHP_EOL;
```

Installation
------------

[](#installation)

Via Composer

SumFinder is available on [Packagist](https://packagist.org/packages/hxtree/sumfinder).

Install with Composer:

```
composer require hxtree/sumfinder
```

Examples
--------

[](#examples)

Learn how SumFinder can be used through our [Docs](docs/README.md).

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

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

2273d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/5bb6e7035bea76f555b113179854f4f0ab66b823ddf84967ba320b5bcc5a3ddb?d=identicon)[hxtree](/maintainers/hxtree)

---

Top Contributors

[![hxtree](https://avatars.githubusercontent.com/u/19890291?v=4)](https://github.com/hxtree "hxtree (12 commits)")[![codacy-badger](https://avatars.githubusercontent.com/u/23704769?v=4)](https://github.com/codacy-badger "codacy-badger (1 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/hxtree-sumfinder/health.svg)

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

###  Alternatives

[povils/figlet

Figlet text generator - PHP

616.8k4](/packages/povils-figlet)[abei2017/yii2-emoji

一个yii2的emoji扩展

161.1k](/packages/abei2017-yii2-emoji)

PHPackages © 2026

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