apcu_entry

apcu_entry

(PECL apcu >= 5.1.0)

apcu_entry Atomically fetch or generate a cache entry

Description

mixed apcu_entry ( string $key , callable $generator [, int $ttl = 0 ] )

Atomically attempts to find key in the cache, if it cannot be found generator is called, passing key as the only argument. The return value of the call is then cached with the optionally specified ttl, and returned.

Note: When control enters 登录查看完整内容