WINCACHE_UCACHE_CAS(3) 1 WINCACHE_UCACHE_CAS(3)wincache_ucache_cas - Compares the variable with old value and assigns new value to itSYNOPSIS
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)
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)
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)
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)
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)
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)