PHPackages                             jonpemby/phlash - 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. jonpemby/phlash

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

jonpemby/phlash
===============

Lodash inspired helper functions for PHP

v0.6.0(7y ago)012[1 issues](https://github.com/jonpemby/phlash/issues)MITPHP

Since Oct 11Pushed 7y ago1 watchersCompare

[ Source](https://github.com/jonpemby/phlash)[ Packagist](https://packagist.org/packages/jonpemby/phlash)[ RSS](/packages/jonpemby-phlash/feed)WikiDiscussions next Synced 2d ago

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

[![Phlash](./img/phlash_logo@2x.png)](./img/phlash_logo@2x.png)

[![Build Status](https://camo.githubusercontent.com/e10e552c241cc88cd4764189055274585833569499f086d4c249159d1b34e29a/68747470733a2f2f7472617669732d63692e6f72672f6a6f6e70656d62792f70686c6173682e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/jonpemby/phlash)

A lodash inspired library of helper functions for PHP.

Fits Into Your Existing Code
----------------------------

[](#fits-into-your-existing-code)

Phlash is meant to be a helpful addition to your code. Phlash adheres directly to your coding style with the help of PHP's dynamic `__call` method. Phlash automatically checks for a function signature matching the one you called for a myriad of styles. While Phlash is written in the `camelCased` style, it will work with any style.

For example:

```
$collection = phlash([1, 2, 3, 4, 5, 6])->dropRight(3);  // [1, 2, 3]
$collection = phlash([1, 2, 3, 4, 5, 6])->drop_right(3); // [1, 2, 3]
$collection = phlash([1, 2, 3, 4, 5, 6])->DropRight(3);  // [1, 2, 3]
```

Will all work!

Immutability
------------

[](#immutability)

Every Phlash collection method returns a new collection. No collection will ever be mutated.

Phlash takes advantage of PHP's copy-on-write principle and assigns the current value to a new variable before mutating it. Nice!

Check it out with [PsySh](https://psysh.org/):

```
$collection = phlash([1, 2, 3, 4, 5, 6]);
// Phlash\Arr {#210}

$another = $collection->map(function ($value) {
    return $value * 2;
});
// Phlash\Arr {#217}
```

Object Oriented With Functional Support
---------------------------------------

[](#object-oriented-with-functional-support)

Phlash supports a variety of paradigms but most importantly the OO and functional paradigms. Methods can easily be chained from a new object. If you would rather call a function without having to deal with an object you can!

For example:

```
Phlash\Arr::from()->fill(null, 0, 3);
// [null, null, null]

phlash([])->fill(null, 0, 3);
// [null, null, null]

fill([], null, 0, 3);
// [null, null, null]
```

While under the hood Phlash uses objects, Phlash supports your favorite paradigm as best it can.

Higher Order Property Accessors
-------------------------------

[](#higher-order-property-accessors)

Phlash supports higher order property accessors for collections. For example:

```
$array = phlash([
    ['foo' => 1],
    ['foo' => 2],
    ['foo' => 3],
    ['foo' => 4],
    ['foo' => 5],
    ['foo' => 6],
]);

$array->foo;
// [1, 2, 3, 4, 5, 6]
```

And yes, this method is chainable to other methods of the same collection. This makes it so much easier to map collections of objects to properties without having to write a map function to handle it for you.

Learn More
----------

[](#learn-more)

Documentation site is coming soon!

Thanks
------

[](#thanks)

- Nan Pemberton for supporting my dream to become a programmer and for being by my side no matter what!
- Taylor Otwell for writing Laravel and inspiring me to be awesome
- You for reading this and showing interest in Phlash. Even if you don't use Phlash, writing PHP keeps the project alive! Thanks for being awesome.

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2771d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/8012318?v=4)[Jonathon Pemberton](/maintainers/jonpemby)[@jonpemby](https://github.com/jonpemby)

---

Top Contributors

[![jonpemby](https://avatars.githubusercontent.com/u/8012318?v=4)](https://github.com/jonpemby "jonpemby (86 commits)")

---

Tags

arrayscollectioncollectionsfunctionshelpersimmutabilityimmutablelodashmathnumbersobjectsphpstrings

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jonpemby-phlash/health.svg)

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

###  Alternatives

[ashallendesign/favicon-fetcher

A Laravel package for fetching website's favicons.

190272.4k3](/packages/ashallendesign-favicon-fetcher)[magepal/magento2-reindex

Reindex your Magento2 store quickly and easily from backend/admin, instead of command line.

112649.7k1](/packages/magepal-magento2-reindex)[redberry/mcp-client-laravel

Package that enables you access to any mcp server that you define in the config

1345.0k1](/packages/redberry-mcp-client-laravel)

PHPackages © 2026

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