NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist · #3154 most downloaded on Packagist
An implementation of the 3D (actually 4D) bin packing/knapsack problem (aka creating parcels by putting items into boxes)
Last release 1 months ago
09 Aug 2026
Ships fairly regularly
a new release about every 5 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
93 releases · first in 2013
Readme update to reflect v2 API changes
Pass on the logger instance from the main Packer class into the helpers
Optimisation when packing a large number of items
One column per quarter.
v1 of BoxPacker is in maintenance mode only, all users are encouraged to update to v3. This release has been made primarily to certify PHP 8 compatibility, unless an egregious bug is discovered (e.g. a physically impossible packing) this will be the last v1 release that includes any changes to core packing logic. (Any) further releases will be limited to compatibility with future PHP versions.
### Changed - Speed enhancements
### Changed - Speed enhancements
ConstrainedItem is now deprecated. Use ConstrainedPlacementItem instead
ConstrainedPlacementItem as a more powerful version of ConstrainedItemConstrainedItem is now deprecated. Use ConstrainedPlacementItem insteadFixed divide by zero warning when attempting to pack an item with 0 depth
Fixed issue where internal sort consistency wasn't always correct
Improved item orientation selection for better packing
Worked around an PHP recursion issue when comparing 2 Items.
Items.Tweaked composer configuration to make it easier to run the samples in the documentation
Improved box selection for certain cases
Improved item orientation selection for better packing
Previously 2 distinct item types could be mixed when sorting items for packing if they had identical physical dimensions. Now if all dimensions are id
Used/remaining space calculations were sometimes offset by 90 degrees leading to confusing numbers
API-compatible backport of 2.4.0. All features present except 3D packing.
API-compatible backport of 2.4.0. All features present except 3D packing.
getUsed[Width|Length|Depth]() on PackedBoxes to allow for better visibility into space utilisationItemTooLargeException exception is now thrown when an item cannot fit inside any boxes rather than a generic \RuntimeExceptionSome refactoring to ease future maintenance
Ensure consistency of packing between PHP 5.x and PHP7/HHVM
Items were occasionally rotated to fit into space that was actually too small for them [IBBoard]
In some cases, items that only fit in a single orientation were being recorded as fitting in the alternate, impossible one [TravisBernard]
Fixed infinite loop that could occur in certain circumstances
Fixed issue with vertical depth calculation where last item in a box could be judged not to fit even though it would
There are no bugfixes or packing logic changes in v2.0 compared to the v1.5.3 release - the bump in version number is purely because the interface cha
There are no bugfixes or packing logic changes in v2.0 compared to the v1.5.3 release - the bump in version number is purely because the interface changed slightly.
Packer->packIntoBox(), Packer->packBox() and Packer->redistributeWeight()Added method for retrieving the volume utilisation of a packed box
Better stacking/depth calculations
Fixed problem where available space calculation inadvertently missed off a dimension
Expose remaining space information on a packed box
Tweaked algorithm to allow limited lookahead when dealing with identical objects to better optimise placement
Generated solutions now have a second pass where multiple boxes are involved, in order to redistribute weight more evenly
### Changed - Minor calculation speedups
Now packs items side by side, not just on top of each other
Supports solutions using multiple boxes
Experimental code to get a feel for how calculations can best be implemented
Initial release
Your coding agent can read these notes before it upgrades. Set up the MCP server →