Browse Source
support for reference value
support for reference value
git-svn-id: svn://svn.lighttpd.net/xcache/trunk@1572 c26eb9a1-5813-0410-bd6c-c2e55f420ca7master

6 changed files with 126 additions and 21 deletions
-
8ChangeLog
-
48mod_cacher/xc_cacher.c
-
23processor/foot.m4
-
24processor/processor.m4
-
41tests/xcache_var_reference.phpt
-
3xcache/xc_compatibility.h
@ -0,0 +1,41 @@ |
|||
--TEST-- |
|||
xcache_set/get test for reference |
|||
--SKIPIF-- |
|||
<?php |
|||
require("skipif.inc"); |
|||
?> |
|||
--INI-- |
|||
xcache.test = 1 |
|||
xcache.size = 32M |
|||
xcache.var_size = 2M |
|||
--FILE-- |
|||
<?php |
|||
$ref = array(); |
|||
$ref['ref'] = &$ref; |
|||
$ref['array'] = array(&$ref); |
|||
var_dump(xcache_set_ref("ref", $ref)); |
|||
|
|||
unset($ref); |
|||
$ref = &xcache_get_ref("ref"); |
|||
var_dump(array(&$ref)); |
|||
|
|||
$ref['test'] = 1; |
|||
var_dump($ref['ref']['test']); |
|||
var_dump($ref['array'][0]['test']); |
|||
?> |
|||
--EXPECT-- |
|||
bool(true) |
|||
array(1) { |
|||
[0]=> |
|||
&array(2) { |
|||
["ref"]=> |
|||
*RECURSION* |
|||
["array"]=> |
|||
array(1) { |
|||
[0]=> |
|||
*RECURSION* |
|||
} |
|||
} |
|||
} |
|||
int(1) |
|||
int(1) |
Write
Preview
Loading…
Cancel
Save
Reference in new issue