From 15582c51383a8711c0bedd2ed7e92df0b3995eae Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 7 Jan 2024 18:47:32 +0000 Subject: [PATCH] [core] default cache TTL to null rather than zero, fixes #997 --- core/polyfills.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/polyfills.php b/core/polyfills.php index 9370bea0..558ce414 100644 --- a/core/polyfills.php +++ b/core/polyfills.php @@ -797,7 +797,7 @@ function stringer($s): string * If a value is in the cache, return it; otherwise, call the callback * to generate it and store it in the cache. */ -function cache_get_or_set(string $key, callable $callback, int $ttl = 0) +function cache_get_or_set(string $key, callable $callback, ?int $ttl = null) { global $cache; $value = $cache->get($key);