Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

wincache_ucache_cas(3) [php man page]

WINCACHE_UCACHE_CAS(3)							 1						    WINCACHE_UCACHE_CAS(3)

wincache_ucache_cas - Compares the variable with old value and assigns new value to it

SYNOPSIS
bool wincache_ucache_cas (string $key, int $old_value, int $new_value) DESCRIPTION
Compares the variable associated with the $key with $old_value and if it matches then assigns the $new_value to it. PARAMETERS
o $key - The $key that is used to store the variable in the cache. $key is case sensitive. o $old_value - Old value of the variable pointed by $key in the user cache. The value should be of type long, otherwise the function returns FALSE. o $new_value - New value which will get assigned to variable pointer by $key if a match is found. The value should be of type long, otherwise the function returns FALSE. RETURN VALUES
Returns TRUE on success or FALSE on failure. EXAMPLES
Example #1 Using wincache_ucache_cas(3) <?php wincache_ucache_set('counter', 2922); var_dump(wincache_ucache_cas('counter', 2922, 1)); var_dump(wincache_ucache_get('counter')); ?> The above example will output: bool(true) int(1) SEE ALSO
wincache_ucache_inc(3), wincache_ucache_dec(3). PHP Documentation Group WINCACHE_UCACHE_CAS(3)

Check Out this Related Man Page

WINCACHE_UCACHE_DEC(3)							 1						    WINCACHE_UCACHE_DEC(3)

wincache_ucache_dec - Decrements the value associated with the key

SYNOPSIS
mixed wincache_ucache_dec (string $key, [int $dec_by = 1], [bool &$success]) DESCRIPTION
Decrements the value associated with the $key by 1 or as specified by $dec_by. PARAMETERS
o $key - The $key that was used to store the variable in the cache. $key is case sensitive. o $dec_by - The value by which the variable associated with the $key will get decremented. If the argument is a floating point number it will be truncated to nearest integer. The variable associated with the $key should be of type long, otherwise the function fails and returns FALSE. o $success - Will be set to TRUE on success and FALSE on failure. RETURN VALUES
Returns the decremented value on success and FALSE on failure. EXAMPLES
Example #1 Using wincache_ucache_dec(3) <?php wincache_ucache_set('counter', 1); var_dump(wincache_ucache_dec('counter', 2923, $success)); var_dump($success); ?> The above example will output: int(2922) bool(true) SEE ALSO
wincache_ucache_inc(3), wincache_ucache_cas(3). PHP Documentation Group WINCACHE_UCACHE_DEC(3)
Man Page

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

counter problem

Hi, I'm attempting to take the following input list and create an output file as shown below. I've monkeyed around for long enough. Can anyone help? NOTE: fs*** will be header and I want to get a count on NY**. fs200a NY7A fs200b NY7B NY7B NY7B fs200c NY7C NY7C NY7C NY7C... (2 Replies)
Discussion started by: jwholey
2 Replies

2. UNIX for Dummies Questions & Answers

dynamic variables

I am new to unix and the following problem is bugging me.:confused: var1="hello1" var2="hello2" var3="hello3" counter=1 while do echo $var$counter done the idea here is to display the value of "var" based on the counter. I am using the korn shell. I used array here but the... (4 Replies)
Discussion started by: max_payne1234
4 Replies

3. Shell Programming and Scripting

incrementing the variable name along with the data?

Hello folks. I am trying to increment my variable names to match a counter that is to be used later on... Basically, i have a for loop that lists directories (for example TEST_OS DVP_OS PROD_OS ) but this loop is not static, it may contain 3 directory once and the next run 5 directories. I... (6 Replies)
Discussion started by: Stephan
6 Replies

4. UNIX for Dummies Questions & Answers

Output checker setting variable to TRUE or FALSE

Hi All, I'm trying to come up a way to check the output of some data i have. I need to be able to check for the order of the output and if its correct set a variable to false if it isnt. Currently the data is in the below format, this is the value which should cause the variable be set... (4 Replies)
Discussion started by: mutley2202
4 Replies

5. Shell Programming and Scripting

Division by zero attempted error during linear conversion of values between 0.25 to 1

I want to implement the below formula with awk oneliner new_value = ((old_value - old_min) / (old_max - old_min) ) * (new_max - new_min) + new_min I want to pass the value of old_min and old_min as variable. Here is what I did for this old_min=$(awk 'BEGIN{a=100000000000}{if ($10<0+a) a=$10}... (2 Replies)
Discussion started by: sammy777888
2 Replies