PHP - Manual: apc_delete_file
2025-11-06
(PECL apc >= 3.1.1)
apc_delete_file — Deletes files from the opcode cache
keysThe files to be deleted. Accepts a string, array of strings, or an APCIterator object.
æåæ¶è¿å TRUEï¼ æè
å¨å¤±è´¥æ¶è¿å FALSEã
Or if keys is an array, then
an empty array is returned on success, or an array of failed files
is returned.
Example #1 apc_delete_file() example
<?php
$filename = 'file.php';
if (apc_compile_file($filename)) {
if (apc_delete_file($filename)) {
echo "Successfully deleted file $filename from APC cache.", PHP_EOL;
}
}
if (apc_compile_file($filename)) {
if ($good = apc_delete_file(array($filename, 'donotexist.php'))) {
var_dump($good);
}
}
$bad = apc_delete_file('donotexist.php');
var_dump($bad);
?>
以ä¸ä¾ç¨çè¾åºç±»ä¼¼äºï¼
Successfully deleted file file.php from APC cache.
[Mon May 24 09:30:33 2010] [apc-warning] Could not stat file donotexist.php, unable to delete from cache. in /tmp/test.php on line 13.
array(1) {
[0]=>
string(14) "donotexist.php"
}
[Mon May 24 09:30:33 2010] [apc-warning] Could not stat file donotexist.php, unable to delete from cache. in /tmp/test.php on line 18.
bool(false)
官方地址:https://www.php.net/manual/en/function.apc-delete-file.php