session_cache_limiter()
session_cache_limiter() — Get and/or set the current cache limiter.
Built-in function of PHP 8.5. The manual lists it as available in PHP 4 >= 4.0.3, PHP 5, PHP 7, PHP 8. This page is the reference card: signature, parameters and return value, plus the changelog and the example the manual provides.
What it does
session_cache_limiter() returns the name of the current cache limiter.
Signature
session_cache_limiter(?string $value = null): string|false
Parameters
| Parameter | Type | What it takes |
|---|---|---|
| $value | ?string | If value is specified and not null, the name of the current cache limiter is changed to the new value. |
Return value
Returns the name of the current cache limiter. On failure to change the value, false is returned.
Example
A runnable snippet:
/* set the cache limiter to 'private' */ session_cache_limiter('private'); $cache_limiter = session_cache_limiter(); echo "The cache limiter is now set to $cache_limiter<br />";
Changelog
| Version | Change |
|---|---|
| 8.0.0 | value is nullable now. |
All PHP 8.5 built-in functions
Reference card built from the PHP manual page session_cache_limiter() (PHP documentation, CC BY 3.0). The page is generated from the manual, so the wording of the parameter and return value text follows php.net.