NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
Packagist
Packagist, #1648 most downloaded on Packagist
A magic memoization function
Latest stable
3.1.3
Last release 1 months ago
19 Oct 2026
Release timing varies
gaps range from 2 months to 2.1 years
Nearly every release is documented
notes for 19 of 20 stable releases
Nothing withdrawn
no release was ever pulled
10 years old
20 releases · first in 2016
Drag across the ruler to compare, or tap a release to open it.
Protect memoization of falsey return values (null, false, 0, 0.0, "", "0", and []), including strict return types and exactly one callback execution (
null, false, 0, 0.0, "", "0", and []), including strict return types and exactly one callback execution (#117).This patch release contains test and tooling changes; production memoization behavior is unchanged.
Full Changelog: https://github.com/spatie/once/compare/3.1.2...3.1.3
Bump dependabot/fetch-metadata from 1.6.0 to 2.1.0 by @dependabot[bot] in https://github.com/spatie/once/pull/97
Full Changelog: https://github.com/spatie/once/compare/3.1.1...3.1.2
Your coding agent can read these notes before it upgrades. Set up the MCP server →
fix spacing by @faisuc in https://github.com/spatie/once/pull/77
Full Changelog: https://github.com/spatie/once/compare/3.1.0...3.1.1
Rewrite phpunit tests to pest by @otsch in https://github.com/spatie/once/pull/73
Full Changelog: https://github.com/spatie/once/compare/3.0.2...3.1.0
Add PHPStan doc blocks by @ThibaudDauce in https://github.com/spatie/once/pull/72
Full Changelog: https://github.com/spatie/once/compare/3.0.1...3.0.2
fix for caching static functions of different classes with the same name
- refactor to use a WeakMap - drop support for PHP 7
WeakMapallow PHP 8
Support global functions
- differentiate between closures
remove excess parameter in get on cache
get on cachedo not throw an error when using once in eval
once in evaldrop support for PHP 7.1 and below
flush methodadd ability to use once in static functions
once in static functionsimprovements around serialization
ditch __memoized in favor of Spatie\Once\Cache
__memoized in favor of Spatie\Once\Cache- add MemoizeAwareTrait
MemoizeAwareTraitfix cacheability of falsy return values
fix cacheability of falsy return values
- initial release
Nothing published for this version
One column per quarter.