![]() Server : Apache/2.4.62 (Unix) OpenSSL/1.0.2k-fips System : Linux server1.richineiserver.com 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64 User : fdshops ( 1003) PHP Version : 8.2.21 Disable Function : NONE Directory : /usr/local/src/apcu-5.1.19/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"); ?> --CONFLICTS-- server --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