wppaste
WordPress

getID3::analyze( string $filename, int $filesize = null, string $original_filename = '', resource $fp = null ): array

Source
wp-includes/ID3/getid3.php:664
analyze file

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

$filenamestring
$filesizeintoptional
Default: null
$original_filenamestringoptional
Default: ''
$fpresourceoptional
Default: null

Return value

array

Performance profile

How much work a call to getID3::analyze() 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 fread().

Scaling
Scales with input

The body loops, so the work grows with what you pass in.

Instructions
49–164

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

Plugin surface
None

Nothing here hands control to plugin code.

Called by
0

Nothing in core calls this; the cost is only what you spend yourself.

What it touches

  • filesystemfilesystem accessfread()called directly

What one call costs · 88 distinct outcomes

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

WhenInstructionsCalls it makes
->openfile() && !isset($value)49–75->openfile(), fseek(), fread(), ->GetFileFormat(), fclose(), ->error()
->openfile() && !isset($value) && !file_exists()67–92->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), fclose(), ->error()
->openfile() && !isset($value) && isset($determined_format)73–78->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), fclose(), ->error()
->openfile() && !isset($value) && isset($determined_format)73–85->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), fclose(), ->error()
->openfile() && !isset($value) && file_exists() && !$class_name74–99->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), ->error()
->openfile() && !isset($value) && isset($determined_format) && !file_exists()80–95->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), fclose(), ->error()
->openfile() && !isset($value) && !file_exists()82–102->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), fclose(), ->error()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && !$class_name87–102->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), ->error()
->openfile() && !isset($value) && isset($determined_format)88->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), fclose(), ->error()
->openfile() && !isset($value) && file_exists() && !$class_name89–109->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), ->error()
->openfile() && !isset($value) && isset($determined_format) && !file_exists()93–98->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), fclose(), ->error()
->openfile() && !isset($value) && isset($determined_format) && !file_exists()95–105->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), fclose(), ->error()
76 further outcomes, up to 164 instructions
->openfile() && !isset($value) && file_exists() && $class_name99–130->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && !$class_name100–105->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), ->error()
->openfile() && !isset($value) && file_exists() && $class_name101–132->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && !$class_name102–112->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), ->error()
->openfile() && !isset($value) && file_exists() && $class_name102–133->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name104–135->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name107–136->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && !file_exists()108->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), fclose(), ->error()
->openfile() && !isset($value) && file_exists() && $class_name109–138->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name109–140->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name111–142->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name112–133->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name112–143->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name114–135->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name114–140->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name114–145->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && !$class_name115->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), ->error()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name115–136->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name116–142->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name117–138->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name117–143->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name117–146->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name119–145->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name119–148->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name120–139->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name122–141->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name122–146->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name122–143->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name124–148->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name124–145->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name124–150->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name125–136->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name125–146->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name126–152->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name127–138->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name127–143->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name127–148->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name127–153->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name128–139->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name129–145->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name129–155->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name130–141->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name130–146->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name130–149->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name132–148->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name132–151->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name132–156->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name133–142->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && file_exists() && $class_name134–158->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name135–144->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name135–149->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name135–146->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name137–151->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name137–148->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name137–153->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name138–149->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name139–155->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name140–146->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name140–151->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name140–156->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name142–148->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name142–158->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name143–149->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name143–152->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name145–151->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name145–154->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name145–159->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name147–161->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name148–152->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name150–154->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name150–156->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name152–158->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name153–159->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name155–161->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name158–162->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name160–164->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->getHashdata(), ->getHashdata(), ->CleanUp()

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-dev34549–156373 more instructions than PHP 8.5
8.534249–16436
8.434249–1643623 fewer instructions than PHP 8.3
8.336549–17536
8.236549–17536
8.136549–17536Different branch profile from PHP 7.4
7.436561–16137

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 · 14

Show all 14

Source code

	public function analyze($filename, $filesize=null, $original_filename='', $fp=null) {		try {			if (!$this->openfile($filename, $filesize, $fp)) {				return $this->info;			} 			// Handle tags			foreach (array('id3v2'=>'id3v2', 'id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) {				$option_tag = 'option_tag_'.$tag_name;				if ($this->$option_tag) {					$this->include_module('tag.'.$tag_name);					try {						$tag_class = 'getid3_'.$tag_name;						$tag = new $tag_class($this);						$tag->Analyze();					}					catch (getid3_exception $e) {						throw $e;					}				} else {					$this->warning('skipping check for '.$tag_name.' tags since option_tag_'.$tag_name.'=FALSE');				}			}			if (isset($this->info['id3v2']['tag_offset_start'])) {				$this->info['avdataoffset'] = max($this->info['avdataoffset'], $this->info['id3v2']['tag_offset_end']);			}			foreach (array('id3v1'=>'id3v1', 'apetag'=>'ape', 'lyrics3'=>'lyrics3') as $tag_name => $tag_key) {				if (isset($this->info[$tag_key]['tag_offset_start'])) {					$this->info['avdataend'] = min($this->info['avdataend'], $this->info[$tag_key]['tag_offset_start']);				}			} 			// ID3v2 detection (NOT parsing), even if ($this->option_tag_id3v2 == false) done to make fileformat easier			if (!$this->option_tag_id3v2) {				fseek($this->fp, 0);				$header = fread($this->fp, 10);				if ((substr($header, 0, 3) == 'ID3') && (strlen($header) == 10)) {					$this->info['id3v2']['header']        = true;					$this->info['id3v2']['majorversion']  = ord($header[3]);					$this->info['id3v2']['minorversion']  = ord($header[4]);					$this->info['avdataoffset']          += getid3_lib::BigEndian2Int(substr($header, 6, 4), 1) + 10; // length of ID3v2 tag in 10-byte header doesn't include 10-byte header length				}			} 			// read 32 kb file data			fseek($this->fp, $this->info['avdataoffset']);			$formattest = fread($this->fp, 32774); 			// determine format			$determined_format = $this->GetFileFormat($formattest, ($original_filename ? $original_filename : $filename)); 			// unable to determine file format			if (!$determined_format) {				fclose($this->fp);				return $this->error('unable to determine file format');			} 			// check for illegal ID3 tags			if (isset($determined_format['fail_id3']) && (in_array('id3v1', $this->info['tags']) || in_array('id3v2', $this->info['tags']))) {				if ($determined_format['fail_id3'] === 'ERROR') {					fclose($this->fp);					return $this->error('ID3 tags not allowed on this file type.');				} elseif ($determined_format['fail_id3'] === 'WARNING') {					$this->warning('ID3 tags not allowed on this file type.');				}			} 			// check for illegal APE tags			if (isset($determined_format['fail_ape']) && in_array('ape', $this->info['tags'])) {				if ($determined_format['fail_ape'] === 'ERROR') {					fclose($this->fp);					return $this->error('APE tags not allowed on this file type.');				} elseif ($determined_format['fail_ape'] === 'WARNING') {					$this->warning('APE tags not allowed on this file type.');				}			} 			// set mime type			$this->info['mime_type'] = $determined_format['mime_type'];

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-includes/ID3/getid3.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.