@@ -53,14 +53,15 @@ function apcu_cas(string $key, int $old, int $new): void
53
53
* @param int $step The step, or value to decrease.
54
54
* @param bool $success Optionally pass the success or fail boolean value to
55
55
* this referenced variable.
56
+ * @param int $ttl TTL to use if the operation inserts a new value (rather than decrementing an existing one).
56
57
* @return int Returns the current value of key's value on success
57
58
* @throws ApcuException
58
59
*
59
60
*/
60
- function apcu_dec (string $ key , int $ step = 1 , ?bool &$ success = null ): int
61
+ function apcu_dec (string $ key , int $ step = 1 , ?bool &$ success = null , int $ ttl = 0 ): int
61
62
{
62
63
error_clear_last ();
63
- $ result = \apcu_dec ($ key , $ step , $ success );
64
+ $ result = \apcu_dec ($ key , $ step , $ success, $ ttl );
64
65
if ($ result === false ) {
65
66
throw ApcuException::createFromPhpError ();
66
67
}
@@ -96,14 +97,15 @@ function apcu_delete($key): void
96
97
* @param int $step The step, or value to increase.
97
98
* @param bool $success Optionally pass the success or fail boolean value to
98
99
* this referenced variable.
100
+ * @param int $ttl TTL to use if the operation inserts a new value (rather than incrementing an existing one).
99
101
* @return int Returns the current value of key's value on success
100
102
* @throws ApcuException
101
103
*
102
104
*/
103
- function apcu_inc (string $ key , int $ step = 1 , ?bool &$ success = null ): int
105
+ function apcu_inc (string $ key , int $ step = 1 , ?bool &$ success = null , int $ ttl = 0 ): int
104
106
{
105
107
error_clear_last ();
106
- $ result = \apcu_inc ($ key , $ step , $ success );
108
+ $ result = \apcu_inc ($ key , $ step , $ success, $ ttl );
107
109
if ($ result === false ) {
108
110
throw ApcuException::createFromPhpError ();
109
111
}
0 commit comments