PATH:
opt
/
cpanel
/
ea-php70
/
root
/
usr
/
share
/
tests
/
pecl
/
apcu
/
tests
--TEST-- APC: Bug #59938 APCIterator fails with large user cache --SKIPIF-- <?php require_once(dirname(__FILE__) . '/skipif.inc'); if (PHP_OS == "WINNT") die("skip not on windows"); if (getenv('USE_ZEND_ALLOC') === '0') die("skip not for valgrind"); ?> --FILE-- <?php include "server_test.inc"; $file = <<<FL //to fill apc cache (~40MB): for(\$i=0;\$i<10000;\$i++) { \$value = str_repeat(md5(microtime()), 100); apcu_store('test-niko-asdfasdfasdfkjasdflkasjdfasf'.\$i, \$value); } //then later (usually after a few minutes) this won't work correctly: \$it = new APCuIterator('#^test-niko-asdfasdfasdfkjasdflkasjdfasf#'); var_dump(\$it->getTotalCount()); //returns 10000 var_dump(\$it->current()); //returns false on error FL; $args = array( 'apc.enabled=1', 'apc.enable_cli=1', 'apc.shm_size=64M', ); server_start($file, $args); for ($i = 0; $i < 3; $i++) { run_test_simple(); } echo 'done'; --EXPECTF-- int(10000) array(11) { ["type"]=> string(4) "user" ["key"]=> string(%d) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" ["value"]=> string(%d) "%s" ["num_hits"]=> int(0) ["mtime"]=> int(%d) ["creation_time"]=> int(%d) ["deletion_time"]=> int(0) ["access_time"]=> int(%d) ["ref_count"]=> int(0) ["mem_size"]=> int(%d) ["ttl"]=> int(0) } int(10000) array(11) { ["type"]=> string(4) "user" ["key"]=> string(%d) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" ["value"]=> string(%d) "%s" ["num_hits"]=> int(0) ["mtime"]=> int(%d) ["creation_time"]=> int(%d) ["deletion_time"]=> int(0) ["access_time"]=> int(%d) ["ref_count"]=> int(0) ["mem_size"]=> int(%d) ["ttl"]=> int(0) } int(10000) array(11) { ["type"]=> string(4) "user" ["key"]=> string(%d) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" ["value"]=> string(%d) "%s" ["num_hits"]=> int(0) ["mtime"]=> int(%d) ["creation_time"]=> int(%d) ["deletion_time"]=> int(0) ["access_time"]=> int(%d) ["ref_count"]=> int(0) ["mem_size"]=> int(%d) ["ttl"]=> int(0) } int(10000) array(11) { ["type"]=> string(4) "user" ["key"]=> string(%d) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" ["value"]=> string(%d) "%s" ["num_hits"]=> int(0) ["mtime"]=> int(%d) ["creation_time"]=> int(%d) ["deletion_time"]=> int(0) ["access_time"]=> int(%d) ["ref_count"]=> int(0) ["mem_size"]=> int(%d) ["ttl"]=> int(0) } int(10000) array(11) { ["type"]=> string(4) "user" ["key"]=> string(%d) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" ["value"]=> string(%d) "%s" ["num_hits"]=> int(0) ["mtime"]=> int(%d) ["creation_time"]=> int(%d) ["deletion_time"]=> int(0) ["access_time"]=> int(%d) ["ref_count"]=> int(0) ["mem_size"]=> int(%d) ["ttl"]=> int(0) } int(10000) array(11) { ["type"]=> string(4) "user" ["key"]=> string(%d) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" ["value"]=> string(%d) "%s" ["num_hits"]=> int(0) ["mtime"]=> int(%d) ["creation_time"]=> int(%d) ["deletion_time"]=> int(0) ["access_time"]=> int(%d) ["ref_count"]=> int(0) ["mem_size"]=> int(%d) ["ttl"]=> int(0) } int(10000) array(11) { ["type"]=> string(4) "user" ["key"]=> string(%d) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" ["value"]=> string(%d) "%s" ["num_hits"]=> int(0) ["mtime"]=> int(%d) ["creation_time"]=> int(%d) ["deletion_time"]=> int(0) ["access_time"]=> int(%d) ["ref_count"]=> int(0) ["mem_size"]=> int(%d) ["ttl"]=> int(0) } int(10000) array(11) { ["type"]=> string(4) "user" ["key"]=> string(%d) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" ["value"]=> string(%d) "%s" ["num_hits"]=> int(0) ["mtime"]=> int(%d) ["creation_time"]=> int(%d) ["deletion_time"]=> int(0) ["access_time"]=> int(%d) ["ref_count"]=> int(0) ["mem_size"]=> int(%d) ["ttl"]=> int(0) } int(10000) array(11) { ["type"]=> string(4) "user" ["key"]=> string(%d) "test-niko-asdfasdfasdfkjasdflkasjdfasf%d" ["value"]=> string(%d) "%s" ["num_hits"]=> int(0) ["mtime"]=> int(%d) ["creation_time"]=> int(%d) ["deletion_time"]=> int(0) ["access_time"]=> int(%d) ["ref_count"]=> int(0) ["mem_size"]=> int(%d) ["ttl"]=> int(0) } done
[-] typed_prop.phpt
[edit]
[-] apc_018.phpt
[edit]
[+]
data
[-] apc_099.phpt
[edit]
[-] apc_020.phpt
[edit]
[-] apc_007.phpt
[edit]
[-] ghbug335.phpt
[edit]
[-] bug63224.phpt
[edit]
[-] apcu_sma_info.phpt
[edit]
[-] iterator_002.phpt
[edit]
[+]
..
[-] apc_disabled.phpt
[edit]
[-] apc_015.phpt
[edit]
[-] iterator_003.phpt
[edit]
[-] bug76145.phpt
[edit]
[-] apc_011.phpt
[edit]
[-] apc54_018.phpt
[edit]
[-] apc_004.phpt
[edit]
[-] ghbug176.phpt
[edit]
[-] apc54_014.phpt
[edit]
[-] 023-2.inc
[edit]
[-] apc_inc_perf.phpt
[edit]
[-] apc_005.phpt
[edit]
[-] apc_001.phpt
[edit]
[-] apc_017.phpt
[edit]
[-] iterator_008.phpt
[edit]
[-] sma001.phpt
[edit]
[-] get_included_files_inc2.inc
[edit]
[-] apc_016.phpt
[edit]
[-] apc_021.phpt
[edit]
[-] apc_entry_003.phpt
[edit]
[-] apc_005b.phpt
[edit]
[-] apc_003b.phpt
[edit]
[-] apc_005c.phpt
[edit]
[-] get_included_files_inc1.inc
[edit]
[-] iterator_006.phpt
[edit]
[-] apc_010.phpt
[edit]
[-] iterator_004.phpt
[edit]
[-] apc_023.phpt
[edit]
[+]
bad
[-] apc_002.phpt
[edit]
[-] skipif.inc
[edit]
[-] not_enough_shm.phpt
[edit]
[-] server_test.inc
[edit]
[-] apc_012.phpt
[edit]
[-] iterator_007.phpt
[edit]
[-] apc_entry_002.phpt
[edit]
[-] iterator_001.phpt
[edit]
[-] ghbug248.phpt
[edit]
[-] apc_006_php73.phpt
[edit]
[-] apc_022.phpt
[edit]
[-] ghbug168.phpt
[edit]
[-] iterator_005.phpt
[edit]
[-] apc_019.phpt
[edit]
[-] iterator_010.phpt
[edit]
[-] 024.phpt
[edit]
[-] apc_entry_001.phpt
[edit]
[-] get_included_files_inc3.inc
[edit]
[-] apc_store_reference.phpt
[edit]
[-] apc_008.phpt
[edit]
[-] ghbug185.phpt
[edit]
[-] apc_014_store_ref.phpt
[edit]
[-] apc_024.phpt
[edit]
[-] iterator_009.phpt
[edit]
[-] apc_006.phpt
[edit]
[-] apc_013_exists.phpt
[edit]
[-] ghbug335-fail.phpt
[edit]
[-] ghbug247.phpt
[edit]