wppaste
WordPress

PclZip::privAddFile( $p_filedescr, $p_header, $p_options )

Source
wp-admin/includes/class-pclzip.php:2530

Compatibility

WordPress
core
PHP
7.4–8.6-dev
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in every tracked release (6.7.7 to 7.1.0), and compiles on PHP 7.4 through 8.6-dev.

Parameters

$p_filedescr
$p_header
$p_options

Performance profile

How much work a call to PclZip::privAddFile() does, and what it touches: the algorithmic scaling, the Zend instruction count per call across PHP versions, the hooks it hands control to, and the core code that calls it. Measured from the compiled opcodes, not a stopwatch, so every number is identical on any machine running the same PHP version, and every function in core is ranked by cost.

Cost class
Heavy

Reads or writes the filesystem via filemtime().

Scaling
Constant

No loop in the body: the same number of instructions runs whatever you pass in.

Instructions
85–218

Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 375.

Plugin surface
None

Nothing here hands control to plugin code.

Called by
1

1 place in core call this, so the cost is paid more often than your own code shows.

What it touches

  • filesystemfilesystem accessfilemtime()called directly

What one call costs · 148 distinct outcomes

One number would be a lie: the work depends on which branch runs. These are every distinct cost PclZip::privAddFile() can have, taken from its control-flow graph on PHP 8.5.

WhenInstructionsCalls it makes
$p_filename != "" && !isset($p_filedescr) && !isset($p_options)85–102clearstatcache(), filemtime()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options)85–98clearstatcache(), time()
$p_filename != "" && !isset($p_filedescr)100–124clearstatcache(), filemtime(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr)100–119clearstatcache(), filemtime(), ->privAddFileUsingTempFile()
$p_filename != "" && !isset($p_filedescr)100–117clearstatcache(), time(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr)100–115clearstatcache(), time(), ->privAddFileUsingTempFile()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options)107–120clearstatcache(), filemtime(), ->privWriteFileHeader()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options)107–116clearstatcache(), time(), ->privWriteFileHeader()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file == 0107–126clearstatcache(), filemtime(), fopen(), ::PclZip(), ::PclZip()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file == 0107–122clearstatcache(), time(), fopen(), ::PclZip(), ::PclZip()
$p_filename != "" && !isset($p_filedescr)111–131clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0111–122clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction()
136 further outcomes, up to 207 instructions
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $p_options && $v_result != 1116–124clearstatcache(), filemtime(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $p_options && $v_result != 1116–120clearstatcache(), time(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !$v_result118–135clearstatcache(), filemtime(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && !$v_result118–131clearstatcache(), time(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options)119–140clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr)119–141clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), ->privAddFileUsingTempFile()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0119–133clearstatcache(), time(), ->privConvertHeader2FileInfo(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0119–134clearstatcache(), time(), ->privConvertHeader2FileInfo(), ->privAddFileUsingTempFile()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && !$p_options && $v_result != 1121–129clearstatcache(), filemtime(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && !$p_options && $v_result != 1121–125clearstatcache(), time(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $p_options && $v_result == 1124–132clearstatcache(), filemtime(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $p_options && $v_result == 1124–128clearstatcache(), time(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result == 1125–136clearstatcache(), filemtime(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_result == 1125–132clearstatcache(), time(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options)126–142clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), ->privWriteFileHeader()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0126–135clearstatcache(), time(), ->privConvertHeader2FileInfo(), ->privWriteFileHeader()
$p_filename != "" && !isset($p_filedescr) && isset($p_options)126–147clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr)126–148clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privAddFileUsingTempFile()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0126–138clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0126–137clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privAddFileUsingTempFile()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file == 0126–148clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), ::PclZip(), ::PclZip()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file == 0126–141clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), ::PclZip(), ::PclZip()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && !$p_options && $v_result == 1129–137clearstatcache(), filemtime(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && !$p_options && $v_result == 1129–133clearstatcache(), time(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && isset($p_options)133–149clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privWriteFileHeader()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0133–140clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privWriteFileHeader()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result != 1133–152clearstatcache(), filemtime(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file == 0133–155clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), ::PclZip(), ::PclZip()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result != 1133–148clearstatcache(), time(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file == 0133–144clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), ::PclZip(), ::PclZip()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $p_options && $v_result != 1135–146clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $p_options && $v_result != 1135–139clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !$v_result137–157clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && !$v_result137–150clearstatcache(), time(), ->privConvertHeader2FileInfo(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1138–157clearstatcache(), filemtime(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1138–153clearstatcache(), time(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && $p_options && $v_result == 1139–148clearstatcache(), filemtime(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $p_options && $v_result == 1139–144clearstatcache(), time(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && !$p_options && $v_result != 1140–151clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && !$p_options && $v_result != 1140–144clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result == 1141–160clearstatcache(), filemtime(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result == 1141–156clearstatcache(), time(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result != 1141–160clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result != 1141–156clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $p_options && $v_result != 1142–153clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $p_options && $v_result != 1142–144clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && $p_options && $v_result == 1143–154clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $p_options && $v_result == 1143–147clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result == 1144–158clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_result == 1144–151clearstatcache(), time(), ->privConvertHeader2FileInfo(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && !$v_result144–164clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && !$v_result144–153clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privAddFileUsingTempFile(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && !$p_options && $v_result == 1144–153clearstatcache(), filemtime(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && !$p_options && $v_result == 1144–149clearstatcache(), time(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1146–165clearstatcache(), filemtime(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1146–161clearstatcache(), time(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1146–165clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1146–161clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && !$p_options && $v_result != 1147–158clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && !$p_options && $v_result != 1147–149clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !$p_options && $v_result == 1148–159clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && !$p_options && $v_result == 1148–152clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result == 1149–168clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && $p_options && $v_result == 1149–164clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $p_options && $v_result == 1150–161clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $p_options && $v_result == 1150–152clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result == 1151–165clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_result == 1151–156clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), ->privWriteFileHeader(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result != 1152–174clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result != 1152–167clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1154–173clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && !isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1154–169clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && !$p_options && $v_result == 1155–166clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && !$p_options && $v_result == 1155–157clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1156–176clearstatcache(), filemtime(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1156–172clearstatcache(), time(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1157–179clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result != 1157–172clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $p_options && $v_result == 1158–170clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $p_options && $v_result == 1158–163clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result != 1159–181clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result != 1159–170clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1160–182clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1160–175clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result != 1160–182clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result != 1160–175clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1161–181clearstatcache(), filemtime(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1161–177clearstatcache(), time(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && !$p_options && $v_result == 1163–175clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && !$p_options && $v_result == 1163–168clearstatcache(), time(), ->privConvertHeader2FileInfo(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1164–184clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1164–180clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1164–186clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result != 1164–175clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $p_options && $v_result == 1165–177clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $p_options && $v_result == 1165–168clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1165–187clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1165–180clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1165–187clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result != 1165–180clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1167–189clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1167–178clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result != 1167–189clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result != 1167–178clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1168–190clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1168–183clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1169–189clearstatcache(), filemtime(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1169–185clearstatcache(), time(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && !$p_options && $v_result == 1170–182clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && !$p_options && $v_result == 1170–173clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1172–194clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1172–183clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result != 1172–194clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result != 1172–183clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fclose()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1173–195clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1173–188clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result == 1175–198clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1175–191clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && $p_options && $v_result == 1175–197clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1175–186clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1180–203clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1180–196clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && $v_file != 0 && !$p_options && $v_result == 1180–202clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1180–191clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result == 1182–205clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1182–194clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result == 1183–206clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1183–199clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1187–210clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1187–199clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1188–211clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1188–204clearstatcache(), time(), ->privConvertHeader2FileInfo(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && $p_options && $v_result == 1190–213clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && $p_options && $v_result == 1190–202clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_file != 0 && !$p_options && $v_result == 1195–218clearstatcache(), filemtime(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()
$p_filename != "" && !isset($p_filedescr) && isset($p_options) && $v_result != 0 && $v_file != 0 && !$p_options && $v_result == 1195–207clearstatcache(), time(), ->privConvertHeader2FileInfo(), PclZipUtilPathReduction(), fopen(), fread(), fclose(), crc32(), gzdeflate(), ->privWriteFileHeader(), fwrite(), ->privConvertHeader2FileInfo()

This body has more branch combinations than are worth enumerating, so the table covers the outcomes found first rather than every one that exists.

Across PHP versions

PHPCompiledExecutedBranchesNotes
8.6-dev37585–21831
8.537585–21831
8.437585–218313 fewer instructions than PHP 8.3
8.337885–21831
8.237885–21831
8.137885–21831
7.437885–21831

An instruction is not a fixed amount of time, so a matching count is not necessarily the same speed; what it rules out is a difference in the work itself.

Uses · 6

Used by · 1

Source code

  function privAddFile($p_filedescr, &$p_header, &$p_options)  {    $v_result=1;     // ----- Working variable    $p_filename = $p_filedescr['filename'];     // TBC : Already done in the fileAtt check ... ?    if ($p_filename == "") {      // ----- Error log      PclZip::privErrorLog(PCLZIP_ERR_INVALID_PARAMETER, "Invalid file list parameter (invalid or empty list)");       // ----- Return      return PclZip::errorCode();    }     // ----- Look for a stored different filename    /* TBC : Removed    if (isset($p_filedescr['stored_filename'])) {      $v_stored_filename = $p_filedescr['stored_filename'];    }    else {      $v_stored_filename = $p_filedescr['stored_filename'];    }    */     // ----- Set the file properties    clearstatcache();    $p_header['version'] = 20;    $p_header['version_extracted'] = 10;    $p_header['flag'] = 0;    $p_header['compression'] = 0;    $p_header['crc'] = 0;    $p_header['compressed_size'] = 0;    $p_header['filename_len'] = strlen($p_filename);    $p_header['extra_len'] = 0;    $p_header['disk'] = 0;    $p_header['internal'] = 0;    $p_header['offset'] = 0;    $p_header['filename'] = $p_filename;// TBC : Removed    $p_header['stored_filename'] = $v_stored_filename;    $p_header['stored_filename'] = $p_filedescr['stored_filename'];    $p_header['extra'] = '';    $p_header['status'] = 'ok';    $p_header['index'] = -1;     // ----- Look for regular file    if ($p_filedescr['type']=='file') {      $p_header['external'] = 0x00000000;      $p_header['size'] = filesize($p_filename);    }     // ----- Look for regular folder    else if ($p_filedescr['type']=='folder') {      $p_header['external'] = 0x00000010;      $p_header['mtime'] = filemtime($p_filename);      $p_header['size'] = filesize($p_filename);    }     // ----- Look for virtual file    else if ($p_filedescr['type'] == 'virtual_file') {      $p_header['external'] = 0x00000000;      $p_header['size'] = strlen($p_filedescr['content']);    }      // ----- Look for filetime    if (isset($p_filedescr['mtime'])) {      $p_header['mtime'] = $p_filedescr['mtime'];    }    else if ($p_filedescr['type'] == 'virtual_file') {      $p_header['mtime'] = time();    }    else {      $p_header['mtime'] = filemtime($p_filename);    }     // ------ Look for file comment    if (isset($p_filedescr['comment'])) {      $p_header['comment_len'] = strlen($p_filedescr['comment']);

Changelog

Unchanged from 6.7.7 through 7.1.0.

  1. 6.7.7
  2. 6.8.8
  3. 6.9.7
  4. 7.0.4
  5. 7.1.0

Signature, return type and hooks compared across 5 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-admin/includes/class-pclzip.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.