Ross ROSS = Recommend OSS · open-source software intelligence for agents

spatie/once

A magic memoization function observed · 2026-08-28

github.com/spatie/once · homepage · PHP · MIT (permissive) observed · 2026-08-28

Health v2 · maintenance only

70/100

  • Activity 91
  • Release rhythm 26
  • Longevity 100
How is this computed?

round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-09-03. Adoption (stars, forks) is never an input.

  • gap_med: n/a
  • age_days: 3587
  • days_rel: 281
  • days_push: 55
  • n_releases_24m: 1

Full methodology

Adoption not part of the score

1446 stars · 62 forks observed · 2026-08-28

What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded

A small PHP package providing a magic `once()` memoization function that caches a callable's result per object instance and argument combination using PHP 8 WeakMaps. It ensures expensive computations run only once per request lifecycle.

Use cases

  • memoize expensive method calls in php
  • cache a function result per object instance
  • avoid recomputing values within the same request
  • memoize static methods with argument-specific results
  • run a callable only once per argument combination

When to choose

  • you need lightweight per-object memoization in PHP 8+
  • you want results cached only for the current request without a global cache
  • you need argument-aware memoization including static contexts

When to avoid

  • you need persistent or cross-request caching (use Redis, APCu, or Laravel cache)
  • you target PHP versions older than 8.0
  • you need cache invalidation or TTL semantics

Facets

library · maturity stable

caching developer-tools performance php memoization weakmap per-request-cache

4 sources

Member repositories

RepositoryRoleHealth v2
spatie/oncemain70

For agents

markdown · JSON · MCP: product_card(name="spatie/once")

Data as of 2026-08-30T08:39:29.467469+00:00 · Report a problem