{"id":89409,"library":"spatie-once","title":"Spatie Once","description":"A magic memoization function","status":"active","version":"3.1.2","language":"php","source_language":null,"source_url":"https://github.com/spatie/once","tags":["memoization","performance","utility"],"install":[{"cmd":"composer require spatie/once","lang":"bash","label":"composer require"}],"dependencies":[],"imports":[{"symbol":"Cache","correct":"use Spatie\\Once\\Cache;"}],"quickstart":{"code":"use Spatie\\Once\\Cache;\n\n$result = once(function () {\n    return expensiveComputation();\n});","lang":"php","description":"Memoize a function call"},"warnings":[{"fix":"Use use statements to pass variables explicitly","message":"The once() function may not work as expected with closures that capture variables by reference","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"search_vec":"'function':6 'magic':4 'memoiz':5,7 'perform':8 'spati':1 'util':9","created_at":"2026-06-19T08:46:44.407921+00:00","updated_at":"2026-06-19T08:46:44.407921+00:00","problems":[],"ecosystem":"packagist","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/spatie/once","github":"https://github.com/spatie/once","docs":null,"changelog":null,"pypi":null,"npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["utility"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-19","next_check":"2026-12-16","install_tag":null}}