golden hour
/opt/alt/tests/alt-php71-pecl-apcu_5.1.23-1.el9/tests
⬆️ Go Up
Upload
File/Folder
Size
Actions
apc_001.phpt
513 B
Del
OK
apc_002.phpt
481 B
Del
OK
apc_003b.phpt
1.74 KB
Del
OK
apc_003b_legacy.phpt
1.69 KB
Del
OK
apc_004.phpt
654 B
Del
OK
apc_005.phpt
635 B
Del
OK
apc_005b.phpt
705 B
Del
OK
apc_005c.phpt
800 B
Del
OK
apc_006.phpt
1.13 KB
Del
OK
apc_006_php73.phpt
1.02 KB
Del
OK
apc_006_php81.phpt
1.25 KB
Del
OK
apc_007.phpt
1.05 KB
Del
OK
apc_008.phpt
838 B
Del
OK
apc_010.phpt
1.3 KB
Del
OK
apc_011.phpt
380 B
Del
OK
apc_012.phpt
606 B
Del
OK
apc_013_exists.phpt
407 B
Del
OK
apc_014_store_ref.phpt
392 B
Del
OK
apc_015.phpt
255 B
Del
OK
apc_016.phpt
613 B
Del
OK
apc_017.phpt
326 B
Del
OK
apc_018.phpt
193 B
Del
OK
apc_019.phpt
732 B
Del
OK
apc_020.phpt
802 B
Del
OK
apc_021.phpt
903 B
Del
OK
apc_022.phpt
620 B
Del
OK
apc_023.phpt
1.15 KB
Del
OK
apc_024.phpt
327 B
Del
OK
apc_025.phpt
423 B
Del
OK
apc_099.phpt
399 B
Del
OK
apc_disabled.phpt
1.83 KB
Del
OK
apc_entry_001.phpt
523 B
Del
OK
apc_entry_002.phpt
434 B
Del
OK
apc_entry_003.phpt
284 B
Del
OK
apc_entry_recursion.phpt
374 B
Del
OK
apc_inc_perf.phpt
548 B
Del
OK
apc_store_array_int_keys.phpt
382 B
Del
OK
apc_store_array_with_refs.phpt
254 B
Del
OK
apc_store_reference.phpt
635 B
Del
OK
apc_store_reference_php8.phpt
606 B
Del
OK
apc_store_string_reuse.phpt
217 B
Del
OK
apcu_fetch_empty_array_reference.phpt
693 B
Del
OK
apcu_sma_info.phpt
583 B
Del
OK
bad
-
Del
OK
bug76145.phpt
886 B
Del
OK
data
-
Del
OK
get_included_files_inc1.inc
28 B
Del
OK
get_included_files_inc2.inc
87 B
Del
OK
get_included_files_inc3.inc
87 B
Del
OK
ghbug168.phpt
469 B
Del
OK
ghbug185.phpt
1.12 KB
Del
OK
ghbug247.phpt
324 B
Del
OK
ghbug248.phpt
2.92 KB
Del
OK
ghbug335-fail.phpt
680 B
Del
OK
ghbug335.phpt
673 B
Del
OK
iterator_001.phpt
1.73 KB
Del
OK
iterator_002.phpt
541 B
Del
OK
iterator_003.phpt
1.75 KB
Del
OK
iterator_004.phpt
594 B
Del
OK
iterator_005.phpt
1.78 KB
Del
OK
iterator_006.phpt
16.52 KB
Del
OK
iterator_007.phpt
1.37 KB
Del
OK
iterator_008.phpt
512 B
Del
OK
iterator_009.phpt
382 B
Del
OK
iterator_010.phpt
942 B
Del
OK
iterator_011.phpt
665 B
Del
OK
not_enough_shm.phpt
329 B
Del
OK
server_test.inc
4.22 KB
Del
OK
skipif.inc
79 B
Del
OK
sma001.phpt
575 B
Del
OK
typed_prop.phpt
678 B
Del
OK
Edit: ghbug248.phpt
--TEST-- GH Bug #248: apcu_fetch may return values causing zend_mm_corruption or segfaults when custom serializer is used --SKIPIF-- <?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> --INI-- apc.enabled=1 apc.enable_cli=1 apc.serializer=default --FILE-- <?php function build_array() { return [ 'params' => 2, 'construct' => ['a'], 'x1' => 'y', 'x2' => 'y', 'x3' => 'y', 'x4' => 'y', 'x5' => 'y', 'x6' => 0, ]; } class MyClass { private $_params; public function __construct($params) { var_dump($params); $this->_params = $params; var_dump($params); $this->_params['ids'] = [4]; $this->_params['loadValue'] = 'x'; unset($this->_params['params']); } } function setup() { apcu_delete('mytestkey'); apcu_store('mytestkey', build_array()); } function test_apcu_fetch() { // Or store second? $value = apcu_fetch('mytestkey'); echo "Fetching the value initially stored into apcu:\n"; var_dump($value); echo "Done dumping initial fetch\n\n"; new MyClass($value); echo "\$value was passed by value, not reference. After instantiating class, the array \$value gets modified\n"; var_dump($value); echo "\nAnd calling apcu_fetch again, the original data is preserved (8 keys, params=2)\n"; var_dump(apcu_fetch('mytestkey')); } setup(); test_apcu_fetch(); ?> --EXPECT-- Fetching the value initially stored into apcu: array(8) { ["params"]=> int(2) ["construct"]=> array(1) { [0]=> string(1) "a" } ["x1"]=> string(1) "y" ["x2"]=> string(1) "y" ["x3"]=> string(1) "y" ["x4"]=> string(1) "y" ["x5"]=> string(1) "y" ["x6"]=> int(0) } Done dumping initial fetch array(8) { ["params"]=> int(2) ["construct"]=> array(1) { [0]=> string(1) "a" } ["x1"]=> string(1) "y" ["x2"]=> string(1) "y" ["x3"]=> string(1) "y" ["x4"]=> string(1) "y" ["x5"]=> string(1) "y" ["x6"]=> int(0) } array(8) { ["params"]=> int(2) ["construct"]=> array(1) { [0]=> string(1) "a" } ["x1"]=> string(1) "y" ["x2"]=> string(1) "y" ["x3"]=> string(1) "y" ["x4"]=> string(1) "y" ["x5"]=> string(1) "y" ["x6"]=> int(0) } $value was passed by value, not reference. After instantiating class, the array $value gets modified array(8) { ["params"]=> int(2) ["construct"]=> array(1) { [0]=> string(1) "a" } ["x1"]=> string(1) "y" ["x2"]=> string(1) "y" ["x3"]=> string(1) "y" ["x4"]=> string(1) "y" ["x5"]=> string(1) "y" ["x6"]=> int(0) } And calling apcu_fetch again, the original data is preserved (8 keys, params=2) array(8) { ["params"]=> int(2) ["construct"]=> array(1) { [0]=> string(1) "a" } ["x1"]=> string(1) "y" ["x2"]=> string(1) "y" ["x3"]=> string(1) "y" ["x4"]=> string(1) "y" ["x5"]=> string(1) "y" ["x6"]=> int(0) }
Save