~ubuntu-branches/ubuntu/vivid/php-apcu/vivid

« back to all changes in this revision

Viewing changes to apcu-4.0.4/tests/iterator_002.phpt

  • Committer: Package Import Robot
  • Author(s): Ondřej Surý
  • Date: 2014-06-24 10:52:52 UTC
  • mfrom: (7.1.4 sid)
  • Revision ID: package-import@ubuntu.com-20140624105252-vsqs1r4og4ykucqg
Tags: 4.0.6-1
* New upstream version 4.0.6
* Remove PHP 5.6 support patch - merged upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--TEST--
2
 
APC: APCIterator regex
3
 
--SKIPIF--
4
 
<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
5
 
--INI--
6
 
apc.enabled=1
7
 
apc.enable_cli=1
8
 
apc.file_update_protection=0
9
 
--FILE--
10
 
<?php
11
 
 
12
 
if (APCU_APC_FULL_BC) {
13
 
        $it = new APCIterator('user', '/key[0-9]0/');
14
 
} else {
15
 
        $it = new APCIterator('/key[0-9]0/');
16
 
}
17
 
for($i = 0; $i < 41; $i++) {
18
 
  apc_store("key$i", "value$i");
19
 
}
20
 
foreach($it as $key=>$value) {
21
 
  $vals[$key] = $value['key'];
22
 
}
23
 
ksort($vals);
24
 
var_dump($vals);
25
 
 
26
 
?>
27
 
===DONE===
28
 
<?php exit(0); ?>
29
 
--EXPECT--
30
 
array(4) {
31
 
  ["key10"]=>
32
 
  string(5) "key10"
33
 
  ["key20"]=>
34
 
  string(5) "key20"
35
 
  ["key30"]=>
36
 
  string(5) "key30"
37
 
  ["key40"]=>
38
 
  string(5) "key40"
39
 
}
40
 
===DONE===