wppaste
WordPress

getID3::__construct()

Source
wp-includes/ID3/getid3.php:399

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.

Performance profile

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

Scaling
Scales with input

The body loops, so the work grows with how much data it finds.

Instructions
57–132

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

Plugin surface
None

Nothing here hands control to plugin code.

Called by
9

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

What it touches

  • filesystemfilesystem accessis_dir()called directly

What one call costs · 80 distinct outcomes

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

WhenInstructionsCalls it makes
!version_compare() && !preg_match() && !$mbstring_func_overload57–78version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare()
!version_compare() && !preg_match() && !$mbstring_func_overload60–75version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare()
!preg_match() && !$mbstring_func_overload && !function_exists()65–86version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists()
!version_compare() && !preg_match() && $mbstring_func_overload66–85version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare()
!preg_match() && !$mbstring_func_overload68–91version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc()
!preg_match() && !$mbstring_func_overload68–91version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists()
!preg_match() && !$mbstring_func_overload && !function_exists()68–83version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), function_exists()
!version_compare() && !preg_match() && $mbstring_func_overload69–82version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare()
!preg_match() && !$mbstring_func_overload && function_exists()71–96version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc()
!preg_match() && !$mbstring_func_overload71–88version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc()
!preg_match() && !$mbstring_func_overload71–88version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists()
!preg_match() && $mbstring_func_overload && !function_exists()74–93version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists()
68 further outcomes, up to 132 instructions
!preg_match() && !$mbstring_func_overload && function_exists()74–93version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc()
!version_compare() && !preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()76–95version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), is_dir(), define()
!version_compare() && !preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()77–96version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), is_dir(), realpath(), define()
!preg_match() && $mbstring_func_overload77–96version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc()
!preg_match() && $mbstring_func_overload77–92version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists()
!preg_match() && $mbstring_func_overload && !function_exists()77–90version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists()
!version_compare() && !preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()79–92version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), is_dir(), define()
!version_compare() && !preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()80–93version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), is_dir(), realpath(), define()
!preg_match() && $mbstring_func_overload && function_exists()80–97version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc()
!preg_match() && $mbstring_func_overload80–95version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc()
!preg_match() && $mbstring_func_overload80–95version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists()
!preg_match() && $mbstring_func_overload && function_exists()83–100version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc()
!preg_match() && !$mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && !is_dir()84–103version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), define()
!version_compare() && !preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()85–102version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), is_dir(), define()
!preg_match() && !$mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()85–104version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), realpath(), define()
!version_compare() && !preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()86–103version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), is_dir(), realpath(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()87–108version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()87–108version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), define()
!preg_match() && !$mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && !is_dir()87–100version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), define()
!version_compare() && !preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()88–99version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), is_dir(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()88–109version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()88–109version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), realpath(), define()
!preg_match() && !$mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()88–101version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), realpath(), define()
!version_compare() && !preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()89–100version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), is_dir(), realpath(), define()
!version_compare() && !preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()90–110version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && !$mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && !is_dir()90–113version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()90–105version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()90–105version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), define()
!preg_match() && !$mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()91–114version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()91–106version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()91–106version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), realpath(), define()
!preg_match() && $mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && !is_dir()93–110version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), define()
!version_compare() && !preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()93–107version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && !$mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && !is_dir()93–110version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), define()
!preg_match() && $mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()94–111version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), realpath(), define()
!preg_match() && !$mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()94–111version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()96–113version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()96–109version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), define()
!preg_match() && $mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && !is_dir()96–107version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()97–114version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()97–110version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), realpath(), define()
!preg_match() && $mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()97–108version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), realpath(), define()
!preg_match() && !$mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()98–118version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), realpath(), realpath(), explode(), define()
!version_compare() && !preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()99–117version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && $mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && !is_dir()99–114version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()99–112version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && !is_dir()99–112version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), define()
!preg_match() && $mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()100–115version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()100–113version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()100–113version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), realpath(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()101–123version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()101–123version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && !$mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()101–115version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), realpath(), realpath(), explode(), define()
!version_compare() && !preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()102–114version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && $mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && !is_dir()102–117version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), define()
!preg_match() && $mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()103–118version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), define()
!preg_match() && !$mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()104–128version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()104–120version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && !$mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()104–120version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && $mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()107–125version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && !$mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()107–125version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()110–128version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()110–124version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && $mbstring_func_overload && !function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()110–122version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && $mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()113–129version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()113–127version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && $mbstring_func_overload && !defined('GETID3_HELPERAPPSDIR') && is_dir()113–127version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), is_dir(), realpath(), realpath(), explode(), define()
!preg_match() && $mbstring_func_overload && function_exists() && !defined('GETID3_HELPERAPPSDIR') && is_dir()116–132version_compare(), ini_get(), preg_match(), preg_match(), ini_get(), ->warning(), ini_get(), ini_get(), version_compare(), function_exists(), get_magic_quotes_runtime(), function_exists(), get_magic_quotes_gpc(), is_dir(), realpath(), realpath(), explode(), define()

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-dev23257–13230
8.523257–13230
8.423257–1323017 fewer instructions than PHP 8.3
8.324960–14130
8.224960–14130
8.124960–141308 more instructions than PHP 7.4
7.424160–13928

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

Used by · 9

Source code

	public function __construct() { 		// Check for PHP version		$required_php_version = '5.3.0';		if (version_compare(PHP_VERSION, $required_php_version, '<')) {			$this->startup_error .= 'getID3() requires PHP v'.$required_php_version.' or higher - you are running v'.PHP_VERSION."\n";			return;		} 		// Check memory		$memoryLimit = ini_get('memory_limit');		if (preg_match('#([0-9]+) ?M#i', $memoryLimit, $matches)) {			// could be stored as "16M" rather than 16777216 for example			$memoryLimit = (int) $matches[1] * 1048576;		} elseif (preg_match('#([0-9]+) ?G#i', $memoryLimit, $matches)) { // The 'G' modifier is available since PHP 5.1.0			// could be stored as "2G" rather than 2147483648 for example			$memoryLimit = (int) $matches[1] * 1073741824;		}		$this->memory_limit = $memoryLimit; 		if ($this->memory_limit <= 0) {			// memory limits probably disabled		} elseif ($this->memory_limit <= 4194304) {			$this->startup_error .= 'PHP has less than 4MB available memory and will very likely run out. Increase memory_limit in php.ini'."\n";		} elseif ($this->memory_limit <= 12582912) {			$this->startup_warning .= 'PHP has less than 12MB available memory and might run out if all modules are loaded. Increase memory_limit in php.ini'."\n";		} 		// Check safe_mode off		if (preg_match('#(1|ON)#i', ini_get('safe_mode'))) {			$this->warning('WARNING: Safe mode is on, shorten support disabled, md5data/sha1data for ogg vorbis disabled, ogg vorbos/flac tag writing disabled.');		} 		if (($mbstring_func_overload = (int) ini_get('mbstring.func_overload')) && ($mbstring_func_overload & 0x02)) {			// http://php.net/manual/en/mbstring.overload.php			// "mbstring.func_overload in php.ini is a positive value that represents a combination of bitmasks specifying the categories of functions to be overloaded. It should be set to 1 to overload the mail() function. 2 for string functions, 4 for regular expression functions"			// getID3 cannot run when string functions are overloaded. It doesn't matter if mail() or ereg* functions are overloaded since getID3 does not use those.			$this->startup_error .= 'WARNING: php.ini contains "mbstring.func_overload = '.ini_get('mbstring.func_overload').'", getID3 cannot run with this setting (bitmask 2 (string functions) cannot be set). Recommended to disable entirely.'."\n";		} 		// check for magic quotes in PHP < 5.4.0 (when these options were removed and getters always return false)		if (version_compare(PHP_VERSION, '5.4.0', '<')) {			// Check for magic_quotes_runtime			if (function_exists('get_magic_quotes_runtime')) {				if (get_magic_quotes_runtime()) { // @phpstan-ignore-line					$this->startup_error .= 'magic_quotes_runtime must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_runtime(0) and set_magic_quotes_runtime(1).'."\n";				}			}			// Check for magic_quotes_gpc			if (function_exists('get_magic_quotes_gpc')) {				if (get_magic_quotes_gpc()) {					$this->startup_error .= 'magic_quotes_gpc must be disabled before running getID3(). Surround getid3 block by set_magic_quotes_gpc(0) and set_magic_quotes_gpc(1).'."\n";				}			}		} 		// Load support library		if (!include_once(GETID3_INCLUDEPATH.'getid3.lib.php')) {			$this->startup_error .= 'getid3.lib.php is missing or corrupt'."\n";		} 		if ($this->option_max_2gb_check === null) {			$this->option_max_2gb_check = (PHP_INT_MAX <= 2147483647);		}  		// Needed for Windows only:		// Define locations of helper applications for Shorten, VorbisComment, MetaFLAC		//   as well as other helper functions such as head, etc		// This path cannot contain spaces, but the below code will attempt to get the		//   8.3-equivalent path automatically		// IMPORTANT: This path must include the trailing slash		if (GETID3_OS_ISWINDOWS && !defined('GETID3_HELPERAPPSDIR')) { 			$helperappsdir = GETID3_INCLUDEPATH.'..'.DIRECTORY_SEPARATOR.'helperapps'; // must not have any space in this path 			if (!is_dir($helperappsdir)) {				$this->startup_warning .= '"'.$helperappsdir.'" cannot be defined as GETID3_HELPERAPPSDIR because it does not exist'."\n";			} elseif (strpos(realpath($helperappsdir), ' ') !== false) {				$DirPieces = explode(DIRECTORY_SEPARATOR, realpath($helperappsdir));

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.