PHP 8.5.0 Beta 3 available for testing

APCUIterator::__construct

(PECL apcu >= 5.0.0)

APCUIterator::__construct โ€” APCUIterator ใ‚คใƒ†ใƒฌใƒผใ‚ฟใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใ‚’ไฝœๆˆใ™ใ‚‹

่ชฌๆ˜Ž

public APCUIterator::__construct(
    array|string|null $search = null,
    int $format = APC_ITER_ALL,
    int $chunk_size = 100,
    int $list = APC_LIST_ACTIVE
)

APCUIterator ใ‚ชใƒ–ใ‚ธใ‚งใ‚ฏใƒˆใ‚’ไฝœๆˆใ—ใพใ™ใ€‚

ใƒ‘ใƒฉใƒกใƒผใ‚ฟ

search

ๅ˜ไธ€ใฎๆ–‡ๅญ—ๅˆ—ใ‚’ๆŒ‡ๅฎšใ™ใ‚‹ๅ ดๅˆใ€APCu ใฎใ‚ญใƒผใฎๅๅ‰ใซใƒžใƒƒใƒใ™ใ‚‹ PCRE ๆญฃ่ฆ่กจ็พใ‚’ๆŒ‡ๅฎšใ—ใพใ™ใ€‚ ้…ๅˆ—ใ‚’ๆŒ‡ๅฎšใ—ใŸๅ ดๅˆใฏใ€APCu ใฎใ‚ญใƒผใฎๅๅ‰ใ‚’ๆŒ‡ๅฎšใ—ใพใ™ใ€‚ null ใ‚’ๆธกใ™ใจใ€ๆคœ็ดขใ‚’ใ‚นใ‚ญใƒƒใƒ—ใ—ใพใ™ใ€‚

format

ๅธŒๆœ›ใ™ใ‚‹ๆ›ธๅผใ€‚ APC_ITER_* ๅฎšๆ•ฐใฎ็ต„ใฟๅˆใ‚ใ›ใงๆŒ‡ๅฎšใ—ใพใ™ใ€‚

chunk_size

ใƒใƒฃใƒณใ‚ฏใ‚ตใ‚คใ‚บใ€‚0 ใ‚ˆใ‚Šๅคงใใ„ๅ€คใงใชใ‘ใ‚Œใฐใชใ‚Šใพใ›ใ‚“ใ€‚ ใƒ‡ใƒ•ใ‚ฉใƒซใƒˆๅ€คใฏ 100 ใงใ™ใ€‚

list

ไธ€่ฆงใซใ™ใ‚‹ๅฝขๅผใ€‚APC_LIST_ACTIVE ใ‚ใ‚‹ใ„ใฏ APC_LIST_DELETED ใ‚’ๆธกใ—ใพใ™ใ€‚

ไพ‹

ไพ‹1 APCUIterator::__construct() ใฎไพ‹

<?php
foreach (new APCUIterator('/^counter\./') as $counter) {
echo
"$counter[key]: $counter[value]\n";
apc_dec($counter['key'], $counter['value']);
}
?>

ๅ‚่€ƒ

  • apcu_exists() - ใ‚จใƒณใƒˆใƒชใŒๅญ˜ๅœจใ™ใ‚‹ใ‹ใฉใ†ใ‹ใ‚’่ชฟในใ‚‹
  • apcu_cache_info() - APCu ใฎใƒ‡ใƒผใ‚ฟใ‹ใ‚‰ใ€ใ‚ญใƒฃใƒƒใ‚ทใƒฅใ•ใ‚ŒใŸๆƒ…ๅ ฑใ‚’ๅ–ๅพ—ใ™ใ‚‹
๏ผ‹add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top