File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed
Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ $memcached = memc_get_instance (array (
1212// Create a key for use as a lock. If this key already exists, wait till it doesn't exist.
1313{
1414 $ key = 'LockKey ' ;
15- $ lockToken = mt_rand (0 , pow ( 2 , 32 )); //Random value betwen 0 and 2^32 for ownership verification
15+ $ lockToken = mt_rand (0 , mt_getrandmax ( )); //Random value for ownership verification
1616
1717 while (true )
1818 {
@@ -88,4 +88,4 @@ array(10) {
8888 int(1 )
8989 ["9_%s " ]=>
9090 int(1 )
91- }
91+ }
Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ echo $php_errormsg, "\n";
4242var_dump ($ m ->get ('foo ' ));
4343
4444echo "Enormous offset \n" ;
45- $ m ->increment ('foo ' , 4294967296 );
45+ $ m ->increment ('foo ' , 0x7f000000 );
4646var_dump ($ m ->get ('foo ' ));
4747
48- $ m ->decrement ('foo ' , 4294967296 );
48+ $ m ->decrement ('foo ' , 0x7f000000 );
4949var_dump ($ m ->get ('foo ' ));
5050
5151--EXPECT --
6868Memcached::decrement (): offset cannot be a negative value
6969int(1 )
7070Enormous offset
71- int (4294967297 )
71+ int (2130706433 )
7272int (1 )
Original file line number Diff line number Diff line change @@ -39,10 +39,10 @@ echo $php_errormsg, "\n";
3939var_dump ($ m ->get ('foo ' ));
4040
4141echo "Enormous offset \n" ;
42- $ m ->incrementByKey ('foo ' , 'foo ' , 4294967296 );
42+ $ m ->incrementByKey ('foo ' , 'foo ' , 0x7f000000 );
4343var_dump ($ m ->get ('foo ' ));
4444
45- $ m ->decrementByKey ('foo ' , 'foo ' , 4294967296 );
45+ $ m ->decrementByKey ('foo ' , 'foo ' , 0x7f000000 );
4646var_dump ($ m ->get ('foo ' ));
4747
4848--EXPECT --
6262Memcached::decrementByKey (): offset cannot be a negative value
6363int(1 )
6464Enormous offset
65- int (4294967297 )
65+ int (2130706433 )
6666int (1 )
You can’t perform that action at this time.
0 commit comments