PHPackages                             haldayne/boost - 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. haldayne/boost

ActiveLibrary

haldayne/boost
==============

Expansion pack for PHP string and array functions. Makes the common stuff easy &amp; legible.

1.1.0(8y ago)930.7k↓100%1[2 issues](https://github.com/haldayne/boost/issues)1MITPHPPHP ^5.5.0 || ^7.0CI failing

Since Dec 23Pushed 8y ago3 watchersCompare

[ Source](https://github.com/haldayne/boost)[ Packagist](https://packagist.org/packages/haldayne/boost)[ RSS](/packages/haldayne-boost/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (2)Versions (13)Used By (1)

*Make the common stuff easy (and legible).*
===========================================

[](#make-the-common-stuff-easy-and-legible)

[![Code Climate](https://camo.githubusercontent.com/258a760d716471892c6c005544cdeb80dc3e291d07d4d24c1d57c06648d88156/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f68616c6461796e652f626f6f73742f6261646765732f6770612e737667)](https://codeclimate.com/github/haldayne/boost)

Most PHP programming consists of data-pushing between a database and a browser, which means a lot of string &amp; array processing. Think about splitting strings, walking arrays, and so on. Sadly, when it comes to this common stuff, PHP is horribly verbose compared to JS, python, etc. This library addresses this sadness with:

- toolbox approach to string manipulation (*TODO*)
- callable-driven, fluent interfaces for array processing

Let's get started
=================

[](#lets-get-started)

You need at least PHP 5.5.0. No other extensions are required.

Install via composer: `php composer.phar require haldayne/boost ^1.0`

Using Boost
===========

[](#using-boost)

[Read the docs](http://haldayne-docs.readthedocs.org/en/latest/boost) for complete examples. For an overview, read on.

Readable, chainable array processing with `Map`
-----------------------------------------------

[](#readable-chainable-array-processing-with-map)

PHP arrays are a collection of `` pairs. The computer science term for this is an [associative array](https://en.wikipedia.org/wiki/Associative_array), also called a dictionary, a hash, or a map. Boost needs a name for its improvement on PHP arrays, and `Map` is good because it's *easy to type* in those insane use statements:

```
use Haldayne\Boost\Map;

```

Now we can use Map's fluent interface to solve real problems:

- use anything as a key: scalars, even *arrays and objects*
- one liner solutions for...
    - map/reduce
    - filter/each
    - partition (aka group by)
    - apply same method to a bunch of objects
    - ... and more
- throw-away callables until PHP supports short closures
    - `$numbers->grep('$v % 2')` vs. `$numbers->grep(function ($v) { return $v % 2; })`
- enforce "Array of Type" type hinting:
    - `Haldayne\Boost\MapOfInts`
    - `Haldayne\Boost\MapOfFloats`
    - `Haldayne\Boost\MapOfStrings`
    - `Haldayne\Boost\MapOfCollections`
    - `Haldayne\Boost\MapOfNumerics`
    - `Haldayne\Boost\MapOfObjects`
    - ... or create your own!

Related projects
================

[](#related-projects)

👽 ➖ [Chain, a consistent and chainable way to work with arrays in PHP.](https://github.com/cocur/chain)

> Working with arrays in PHP is a mess. First of all, you have to prefix most (but not all) functions with array\_, the parameter ordering is not consistent. For example, array\_map() expects the callback as first parameter and the array as the second, but array\_filter() expects the array as first and the callback as second. You also have to wrap the function calls around the array, the resulting code is not nice to look at, not readable and hard to understand.

👽 ➖ [Ardent, a Collections library for PHP.](https://github.com/morrisonlevi/Ardent)

> While developing and helping others develop PHP applications I noticed the trend to use PHP's arrays in nearly every task. Arrays in PHP are useful but are overused because PHP doesn't have rich standard libraries for working with common data structures and algorithms. This library hopes to fill in that gap. Undoubtably, I've made mistakes in design and implementation; hopefully more community involvement can help identify and fix such mistakes.

👽 ➖ [PHP Collection - Basic collections for PHP.](http://jmsyst.com/libs/PHP-Collection)

> Collections can be seen as more specialized arrays for which certain contracts are guaranteed.
>
> Supported Collections:
>
> - Sequences
> - Maps
> - Sets (not yet implemented)

###  Health Score

35

—

LowBetter than 81% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity31

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

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

Every ~62 days

Recently: every ~137 days

Total

12

Last Release

3053d ago

PHP version history (2 changes)1.0.0PHP ^5.5.0

1.0.9PHP ^5.5.0 || ^7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/f7d1b2950f32597fbcd30215950167fb1390c6bdd7da5f8820b3e0c7f7c69a64?d=identicon)[bishopb](/maintainers/bishopb)

---

Top Contributors

[![bishopb](https://avatars.githubusercontent.com/u/6844145?v=4)](https://github.com/bishopb "bishopb (67 commits)")[![deevus](https://avatars.githubusercontent.com/u/856194?v=4)](https://github.com/deevus "deevus (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/haldayne-boost/health.svg)

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

PHPackages © 2026

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