File: incrdecr_64.phpt

package info (click to toggle)
php-memcached 3.2.0%2B2.2.0-4
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,568 kB
  • sloc: ansic: 9,752; xml: 1,350; php: 478; pascal: 123; sh: 12; makefile: 5
file content (39 lines) | stat: -rw-r--r-- 807 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--TEST--
64-bit Memcached::increment() decrement() incrementByKey() decrementByKey()
--SKIPIF--
<?php
include "skipif.inc";
if (PHP_INT_SIZE < 8) die("skip valid for 64-bit PHP only");
?>
--FILE--
<?php
include dirname (__FILE__) . '/config.inc';
$m = memc_get_instance ();

echo "Normal\n";
$m->set('foo', 1);
var_dump($m->get('foo'));

echo "Enormous offset 64-bit\n";
$m->increment('foo', 0x100000000);
var_dump($m->get('foo'));

$m->decrement('foo', 0x100000000);
var_dump($m->get('foo'));

echo "Enormous offset 64-bit by key\n";
$m->incrementByKey('foo', 'foo', 0x100000000);
var_dump($m->get('foo'));

$m->decrementByKey('foo', 'foo', 0x100000000);
var_dump($m->get('foo'));

--EXPECT--
Normal
int(1)
Enormous offset 64-bit
int(4294967297)
int(1)
Enormous offset 64-bit by key
int(4294967297)
int(1)