source: svn/trunk/tests/xcache_var_reference.phpt @ 1572

Last change on this file since 1572 was 1572, checked in by Xuefer, 5 years ago

support for reference value

File size: 600 bytes
Line 
1--TEST--
2xcache_set/get test for reference
3--SKIPIF--
4<?php
5require("skipif.inc");
6?>
7--INI--
8xcache.test = 1
9xcache.size = 32M
10xcache.var_size = 2M
11--FILE--
12<?php
13$ref = array();
14$ref['ref'] = &$ref;
15$ref['array'] = array(&$ref);
16var_dump(xcache_set_ref("ref", $ref));
17
18unset($ref);
19$ref = &xcache_get_ref("ref");
20var_dump(array(&$ref));
21
22$ref['test'] = 1;
23var_dump($ref['ref']['test']);
24var_dump($ref['array'][0]['test']);
25?>
26--EXPECT--
27bool(true)
28array(1) {
29  [0]=>
30  &array(2) {
31    ["ref"]=>
32    *RECURSION*
33    ["array"]=>
34    array(1) {
35      [0]=>
36      *RECURSION*
37    }
38  }
39}
40int(1)
41int(1)
Note: See TracBrowser for help on using the repository browser.