We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5bd38b5 commit 45305d7Copy full SHA for 45305d7
2 files changed
user_guide_src/source/libraries/caching.rst
@@ -145,8 +145,8 @@ Class Reference
145
calculation.
146
147
When a callable is provided, it will only be executed on a cache miss,
148
- after the callback has been invoked. The callable may optionally accept
149
- the computed value as its first argument:
+ after the callback has been invoked. The callable always receives the
+ computed value as its first argument:
150
151
.. literalinclude:: caching/015.php
152
user_guide_src/source/libraries/caching/015.php
@@ -1,7 +1,7 @@
1
<?php
2
3
// Simple dynamic TTL
4
-$cache->remember('key', static fn () => 60, static fn () => fetchData());
+$cache->remember('key', static fn ($value) => 60, static fn () => fetchData());
5
6
// Value-aware TTL
7
$cache->remember(
0 commit comments