PHPackages                             dagmike/bin-packing - 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. dagmike/bin-packing

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

dagmike/bin-packing
===================

2D bin packing PHP implementation

1.7.2(5y ago)109.9k↓16.7%8[6 issues](https://github.com/dagmike/BinPacking/issues)[2 PRs](https://github.com/dagmike/BinPacking/pulls)MITPHPPHP &gt;=5.6

Since Aug 12Pushed 3y ago1 watchersCompare

[ Source](https://github.com/dagmike/BinPacking)[ Packagist](https://packagist.org/packages/dagmike/bin-packing)[ RSS](/packages/dagmike-bin-packing/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)DependenciesVersions (13)Used By (0)

2D Bin Packing Algorithms using PHP
===================================

[](#2d-bin-packing-algorithms-using-php)

This repository is a port of the 2D bin packing algorithms found here: [juj/RectangleBinPack](https://www.github.com/juj/RectangleBinPack) into PHP.

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

[](#installation)

You can install the package via composer:

```
composer require dagmike/bin-packing
```

Usage
-----

[](#usage)

```
use BinPacking\RectangleBinPack;
use BinPacking\Rectangle;

$bin = (new RectangleBinPack(1000, 1000))->init();

$packed = $bin->insert(new Rectangle(100, 100), "RectBestAreaFit");

if ($packed) {
    echo "Item ({$packed->getWidth()}x{$packed->getHeight()}) packed at position ({$packed->getX()}, {$packed->getY()})";
} else {
    echo "Unable to pack item";
}
```

Currently Implemented Algorithms
--------------------------------

[](#currently-implemented-algorithms)

- Maximum Rectangles
    - Bottom-Left - RectBottomLeft
    - Best Area Fit - RectBestAreaFit
    - Best Short Side Fit - RectBestShortSideFit
    - Best Long Side Fit - RectBestLongSideFit
    - Linear - RectLinear

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance8

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% 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 ~141 days

Total

10

Last Release

1906d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/919d4d0b4d078d29817badfe6208af160157b40c744c683d3e2ef39a3894bae1?d=identicon)[shrimpwagon](/maintainers/shrimpwagon)

---

Top Contributors

[![dagmike](https://avatars.githubusercontent.com/u/3410055?v=4)](https://github.com/dagmike "dagmike (35 commits)")[![neekfenwick](https://avatars.githubusercontent.com/u/266415?v=4)](https://github.com/neekfenwick "neekfenwick (9 commits)")[![shrimpwagon](https://avatars.githubusercontent.com/u/101164?v=4)](https://github.com/shrimpwagon "shrimpwagon (1 commits)")

### Embed Badge

![Health badge](/badges/dagmike-bin-packing/health.svg)

```
[![Health](https://phpackages.com/badges/dagmike-bin-packing/health.svg)](https://phpackages.com/packages/dagmike-bin-packing)
```

###  Alternatives

[mwdelaney/sage-fonts-preload

Automatically preload fonts from the Sage mix manifest

188.3k](/packages/mwdelaney-sage-fonts-preload)

PHPackages © 2026

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