File tree 3 files changed +8
-8
lines changed
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 (
12
12
// Create a key for use as a lock. If this key already exists, wait till it doesn't exist.
13
13
{
14
14
$ 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
16
16
17
17
while (true )
18
18
{
@@ -88,4 +88,4 @@ array(10) {
88
88
int(1 )
89
89
["9_%s " ]=>
90
90
int(1 )
91
- }
91
+ }
Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ echo $php_errormsg, "\n";
42
42
var_dump ($ m ->get ('foo ' ));
43
43
44
44
echo "Enormous offset \n" ;
45
- $ m ->increment ('foo ' , 4294967296 );
45
+ $ m ->increment ('foo ' , 0x7f000000 );
46
46
var_dump ($ m ->get ('foo ' ));
47
47
48
- $ m ->decrement ('foo ' , 4294967296 );
48
+ $ m ->decrement ('foo ' , 0x7f000000 );
49
49
var_dump ($ m ->get ('foo ' ));
50
50
51
51
--EXPECT --
68
68
Memcached::decrement (): offset cannot be a negative value
69
69
int(1 )
70
70
Enormous offset
71
- int (4294967297 )
71
+ int (2130706433 )
72
72
int (1 )
Original file line number Diff line number Diff line change @@ -39,10 +39,10 @@ echo $php_errormsg, "\n";
39
39
var_dump ($ m ->get ('foo ' ));
40
40
41
41
echo "Enormous offset \n" ;
42
- $ m ->incrementByKey ('foo ' , 'foo ' , 4294967296 );
42
+ $ m ->incrementByKey ('foo ' , 'foo ' , 0x7f000000 );
43
43
var_dump ($ m ->get ('foo ' ));
44
44
45
- $ m ->decrementByKey ('foo ' , 'foo ' , 4294967296 );
45
+ $ m ->decrementByKey ('foo ' , 'foo ' , 0x7f000000 );
46
46
var_dump ($ m ->get ('foo ' ));
47
47
48
48
--EXPECT --
62
62
Memcached::decrementByKey (): offset cannot be a negative value
63
63
int(1 )
64
64
Enormous offset
65
- int (4294967297 )
65
+ int (2130706433 )
66
66
int (1 )
You can’t perform that action at this time.
0 commit comments