getID3::analyze( string $filename, int $filesize = null, string $original_filename = '', resource $fp = null ): array
- Source
wp-includes/ID3/getid3.php:664
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
- Scaling
- Scales with input
- Instructions
- 49–164
- Plugin surface
- None
- Called by
- 0
Reads or writes the filesystem via fread().
The body loops, so the work grows with what you pass in.
Executed per call on PHP 8.5, depending on the branch taken. The body compiles to 342.
Nothing here hands control to plugin code.
Nothing in core calls this; the cost is only what you spend yourself.
What it touches
- filesystemfilesystem access
fread()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.
| When | Instructions | Calls 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_name | 74–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_name | 87–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_name | 89–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_name | 99–130 | ->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->CleanUp() |
->openfile() && !isset($value) && isset($determined_format) && file_exists() && !$class_name | 100–105 | ->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), ->error() |
->openfile() && !isset($value) && file_exists() && $class_name | 101–132 | ->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->CleanUp() |
->openfile() && !isset($value) && isset($determined_format) && file_exists() && !$class_name | 102–112 | ->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), ->error() |
->openfile() && !isset($value) && file_exists() && $class_name | 102–133 | ->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 104–135 | ->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 107–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_name | 109–138 | ->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->getHashdata(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 109–140 | ->openfile(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->ChannelsBitratePlaytimeCalculations(), ->CalculateCompressionRatioVideo(), ->CalculateCompressionRatioAudio(), ->CalculateReplayGain(), ->ProcessAudioStreams(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 111–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_name | 112–133 | ->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 112–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_name | 114–135 | ->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 114–140 | ->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 114–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_name | 115 | ->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), ->error() |
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name | 115–136 | ->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 116–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_name | 117–138 | ->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 117–143 | ->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 117–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_name | 119–145 | ->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 119–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_name | 120–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_name | 122–141 | ->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->getHashdata(), ->getHashdata(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 122–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_name | 122–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_name | 124–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_name | 124–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_name | 124–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_name | 125–136 | ->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->CleanUp() |
->openfile() && !isset($value) && isset($determined_format) && file_exists() && $class_name | 125–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_name | 126–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_name | 127–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_name | 127–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_name | 127–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_name | 127–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_name | 128–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_name | 129–145 | ->openfile(), fseek(), fread(), fseek(), fread(), ->GetFileFormat(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->HandleAllTags(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 129–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_name | 130–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_name | 130–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_name | 130–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_name | 132–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_name | 132–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_name | 132–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_name | 133–142 | ->openfile(), fseek(), fread(), ->GetFileFormat(), ->warning(), ->warning(), file_exists(), get_object_vars(), ->Analyze(), fclose(), ->getHashdata(), ->getHashdata(), ->CleanUp() |
->openfile() && !isset($value) && file_exists() && $class_name | 134–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_name | 135–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_name | 135–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_name | 135–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_name | 137–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_name | 137–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_name | 137–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_name | 138–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_name | 139–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_name | 140–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_name | 140–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_name | 140–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_name | 142–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_name | 142–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_name | 143–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_name | 143–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_name | 145–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_name | 145–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_name | 145–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_name | 147–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_name | 148–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_name | 150–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_name | 150–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_name | 152–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_name | 153–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_name | 155–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_name | 158–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_name | 160–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
| PHP | Compiled | Executed | Branches | Notes |
|---|---|---|---|---|
| 8.6-dev | 345 | 49–156 | 37 | 3 more instructions than PHP 8.5 |
| 8.5 | 342 | 49–164 | 36 | |
| 8.4 | 342 | 49–164 | 36 | 23 fewer instructions than PHP 8.3 |
| 8.3 | 365 | 49–175 | 36 | |
| 8.2 | 365 | 49–175 | 36 | |
| 8.1 | 365 | 49–175 | 36 | Different branch profile from PHP 7.4 |
| 7.4 | 365 | 61–161 | 37 |
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
- getID3::openfile()
- getID3::include_module()
- getID3::warning()Warning handling.
- getid3_lib::BigEndian2Int()
- getID3::GetFileFormat()
- getID3::error()Error handling.
- getID3::HandleAllTags()
- getID3::ChannelsBitratePlaytimeCalculations()
- getID3::CalculateCompressionRatioVideo()
- getID3::CalculateCompressionRatioAudio()
- getID3::CalculateReplayGain()
- getID3::ProcessAudioStreams()
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.
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.