File: iterator_003.phpt

package info (click to toggle)
php-apcu 5.1.17%2B4.0.11-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,888 kB
  • sloc: ansic: 11,028; php: 1,705; xml: 859; pascal: 5; makefile: 1
file content (114 lines) | stat: -rw-r--r-- 1,931 bytes parent folder | download | duplicates (5)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
--TEST--
APC: APCIterator chunk size
--SKIPIF--
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
--INI--
apc.enabled=1
apc.enable_cli=1
apc.file_update_protection=0
--FILE--
<?php

if (APCU_APC_FULL_BC) {
	$it = new APCIterator('user', NULL, APC_ITER_ALL, 10);
} else {
	$it = new APCIterator(NULL, APC_ITER_ALL, 10);
}
for($i = 0; $i < 41; $i++) {
  apc_store("key$i", "value$i");
}
foreach($it as $key=>$value) {
  $vals[$key] = $value['key'];
}
ksort($vals);
var_dump($vals);

?>
===DONE===
<?php exit(0); ?>
--EXPECT--
array(41) {
  ["key0"]=>
  string(4) "key0"
  ["key1"]=>
  string(4) "key1"
  ["key10"]=>
  string(5) "key10"
  ["key11"]=>
  string(5) "key11"
  ["key12"]=>
  string(5) "key12"
  ["key13"]=>
  string(5) "key13"
  ["key14"]=>
  string(5) "key14"
  ["key15"]=>
  string(5) "key15"
  ["key16"]=>
  string(5) "key16"
  ["key17"]=>
  string(5) "key17"
  ["key18"]=>
  string(5) "key18"
  ["key19"]=>
  string(5) "key19"
  ["key2"]=>
  string(4) "key2"
  ["key20"]=>
  string(5) "key20"
  ["key21"]=>
  string(5) "key21"
  ["key22"]=>
  string(5) "key22"
  ["key23"]=>
  string(5) "key23"
  ["key24"]=>
  string(5) "key24"
  ["key25"]=>
  string(5) "key25"
  ["key26"]=>
  string(5) "key26"
  ["key27"]=>
  string(5) "key27"
  ["key28"]=>
  string(5) "key28"
  ["key29"]=>
  string(5) "key29"
  ["key3"]=>
  string(4) "key3"
  ["key30"]=>
  string(5) "key30"
  ["key31"]=>
  string(5) "key31"
  ["key32"]=>
  string(5) "key32"
  ["key33"]=>
  string(5) "key33"
  ["key34"]=>
  string(5) "key34"
  ["key35"]=>
  string(5) "key35"
  ["key36"]=>
  string(5) "key36"
  ["key37"]=>
  string(5) "key37"
  ["key38"]=>
  string(5) "key38"
  ["key39"]=>
  string(5) "key39"
  ["key4"]=>
  string(4) "key4"
  ["key40"]=>
  string(5) "key40"
  ["key5"]=>
  string(4) "key5"
  ["key6"]=>
  string(4) "key6"
  ["key7"]=>
  string(4) "key7"
  ["key8"]=>
  string(4) "key8"
  ["key9"]=>
  string(4) "key9"
}
===DONE===