XCache is a fast, stable PHP opcode cacher that has been proven and is now running on production servers under high load.
https://xcache.lighttpd.net/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
887 B
67 lines
887 B
--TEST-- |
|
xcache_set/get test for object PHP 5.2+ |
|
--SKIPIF-- |
|
<?php |
|
require("skipif.inc"); |
|
if (!version_compare(phpversion(), '5.2', '>=')) { |
|
echo 'skip for PHP 5.2+ only'; |
|
} |
|
?> |
|
--INI-- |
|
xcache.test = 1 |
|
xcache.size = 32M |
|
xcache.var_size = 2M |
|
--FILE-- |
|
<?php |
|
class a |
|
{ |
|
} |
|
|
|
class b |
|
{ |
|
} |
|
|
|
$a = new a(); |
|
$b = new b(); |
|
$stdclass = new stdclass(); |
|
|
|
$b->a = $a; |
|
$b->b = $b; |
|
$b->array = array($b, $a); |
|
$b->stdclass = $stdclass; |
|
|
|
var_dump(xcache_set("a", $a)); |
|
unset($a); |
|
var_dump($a = xcache_get("a")); |
|
|
|
var_dump(xcache_set("b", $b)); |
|
unset($b); |
|
var_dump($b = xcache_get("b")); |
|
|
|
$b->test = 1; |
|
var_dump($b->b->test); |
|
?> |
|
--EXPECT-- |
|
bool(true) |
|
object(a)#4 (0) { |
|
} |
|
bool(true) |
|
object(b)#7 (4) { |
|
["a"]=> |
|
object(a)#6 (0) { |
|
} |
|
["b"]=> |
|
*RECURSION* |
|
["array"]=> |
|
array(2) { |
|
[0]=> |
|
*RECURSION* |
|
[1]=> |
|
object(a)#6 (0) { |
|
} |
|
} |
|
["stdclass"]=> |
|
object(stdClass)#5 (0) { |
|
} |
|
} |
|
int(1)
|
|
|