3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Autoloader { private $directory; private $prefix; private $prefixLength; /** * @param string $baseDirectory Base directory where the source files are located. */ public function __construct($baseDirectory = __DIR__) { $this->directory = $baseDirectory; $this->prefix = __NAMESPACE__ . '\\'; $this->prefixLength = strlen($this->prefix); } /** * Registers the autoloader class with the PHP SPL autoloader. * * @param boolean $prepend Prepend the autoloader on the stack instead of appending it. */ public static function register($prepend = false) { spl_autoload_register(array(new self, 'autoload'), true, $prepend); } /** * Loads a class from a file using its fully qualified name. * * @param string $className Fully qualified name of a class. */ public function autoload($className) { if (0 === strpos($className, $this->prefix)) { $parts = explode('\\', substr($className, $this->prefixLength)); $filepath = $this->directory.DIRECTORY_SEPARATOR.implode(DIRECTORY_SEPARATOR, $parts).'.php'; if (is_file($filepath)) { require($filepath); } } } }

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
8.3.60.0140.00718.18
8.3.50.0110.01021.90
8.3.40.0120.00918.54
8.3.30.0110.00318.84
8.3.20.0080.00020.15
8.3.10.0040.00421.96
8.3.00.0040.00422.52
8.2.180.0110.01116.32
8.2.170.0110.00722.96
8.2.160.0070.00720.82
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0070.00026.16
8.2.120.0040.00417.50
8.2.110.0060.00322.08
8.2.100.0090.00317.78
8.2.90.0030.00618.97
8.2.80.0000.00819.64
8.2.70.0050.00517.13
8.2.60.0040.00417.90
8.2.50.0000.00818.07
8.2.40.0030.00717.95
8.2.30.0040.00817.94
8.2.20.0050.00317.53
8.2.10.0040.00419.25
8.2.00.0000.00717.54
8.1.280.0070.01125.92
8.1.270.0100.01022.04
8.1.260.0060.00326.35
8.1.250.0040.00428.09
8.1.240.0090.00023.92
8.1.230.0090.00319.00
8.1.220.0000.00717.74
8.1.210.0030.00518.77
8.1.200.0000.00817.23
8.1.190.0030.00617.41
8.1.180.0030.00518.10
8.1.170.0040.00418.54
8.1.160.0040.00421.96
8.1.150.0040.00418.45
8.1.140.0030.00617.40
8.1.130.0040.00417.71
8.1.120.0040.00417.38
8.1.110.0000.00717.24
8.1.100.0040.00417.37
8.1.90.0030.00317.34
8.1.80.0000.00817.34
8.1.70.0030.00317.32
8.1.60.0080.00017.50
8.1.50.0030.00617.43
8.1.40.0030.00517.43
8.1.30.0000.00717.54
8.1.20.0040.00417.58
8.1.10.0030.00517.38
8.1.00.0040.00417.28
8.0.300.0040.00418.77
8.0.290.0000.00717.04
8.0.280.0000.00718.32
8.0.270.0040.00417.14
8.0.260.0000.00716.75
8.0.250.0030.00316.71
8.0.240.0040.00416.82
8.0.230.0000.00816.73
8.0.220.0000.00716.77
8.0.210.0070.00016.74
8.0.200.0090.00016.79
8.0.190.0030.00316.73
8.0.180.0000.00816.84
8.0.170.0000.00816.74
8.0.160.0040.00416.77
8.0.150.0000.00716.80
8.0.140.0040.00416.75
8.0.130.0000.00513.30
8.0.120.0040.00416.73
8.0.110.0050.00216.75
8.0.100.0000.00716.77
8.0.90.0040.00416.84
8.0.80.0060.00916.73
8.0.70.0040.00416.89
8.0.60.0000.00716.84
8.0.50.0070.00016.77
8.0.30.0120.00616.88
8.0.20.0120.00617.40
8.0.10.0050.00216.75
8.0.00.0070.01216.59
7.4.330.0020.00215.00
7.4.320.0000.00616.29
7.4.300.0060.00016.46
7.4.290.0030.00316.47
7.4.280.0030.00316.39
7.4.270.0030.00316.57
7.4.260.0000.00716.39
7.4.250.0050.00316.44
7.4.240.0030.00416.36
7.4.230.0040.00416.49
7.4.220.0090.00916.34
7.4.210.0050.01116.46
7.4.200.0030.00316.29
7.4.190.0000.00816.64
7.4.160.0060.01016.23
7.4.150.0130.00617.40
7.4.140.0080.01117.86
7.4.130.0050.01216.40
7.4.120.0070.01216.47
7.4.110.0080.00816.50
7.4.100.0030.01316.34
7.4.90.0110.00516.29
7.4.80.0100.00619.39
7.4.70.0100.01316.23
7.4.60.0100.00716.16
7.4.50.0000.00816.23
7.4.40.0100.00722.77
7.4.30.0040.01216.49
7.4.00.0080.00514.98
7.3.330.0000.00513.16
7.3.320.0000.00513.20
7.3.310.0000.00716.03
7.3.300.0030.00316.19
7.3.290.0040.01216.19
7.3.280.0100.00816.20
7.3.270.0160.00017.40
7.3.260.0040.01216.25
7.3.250.0120.00516.28
7.3.240.0070.01016.19
7.3.230.0090.00816.39
7.3.210.0130.00316.35
7.3.200.0130.00519.39
7.3.190.0120.00916.29
7.3.180.0090.00616.16
7.3.170.0060.01016.27
7.3.160.0080.00816.42
7.3.120.0110.00714.75
7.3.110.0070.01014.69
7.3.100.0060.01214.64
7.3.90.0040.01414.97
7.3.80.0030.01014.61
7.3.70.0050.00514.70
7.3.60.0090.00614.35
7.3.50.0040.01114.36
7.3.40.0000.01414.71
7.3.30.0090.00914.54
7.3.20.0120.00316.61
7.3.10.0080.00816.14
7.3.00.0030.01216.61
7.2.330.0100.01016.57
7.2.320.0120.00616.59
7.2.310.0040.01516.38
7.2.300.0130.00716.36
7.2.290.0110.00616.61
7.2.250.0060.01014.84
7.2.240.0110.00714.44
7.2.230.0030.00914.97
7.2.220.0090.00615.03
7.2.210.0030.01014.79
7.2.200.0140.00314.59
7.2.190.0090.00314.91
7.2.180.0070.01014.59
7.2.170.0060.01014.82
7.2.60.0030.01216.90
7.2.00.0100.00718.97
7.1.330.0070.00715.51
7.1.320.0070.00715.71
7.1.310.0170.00015.63
7.1.300.0040.00715.50
7.1.290.0030.00615.78
7.1.280.0120.00315.31
7.1.270.0100.00715.65
7.1.260.0030.01415.71
7.1.200.0040.00815.70
7.1.100.0060.00617.98
7.1.70.0030.01016.67
7.1.60.0090.01619.82
7.1.50.0070.01016.70
7.1.00.0030.07722.43
7.0.200.0000.00716.42
7.0.140.0000.07722.05
7.0.80.0530.06719.91
7.0.70.0500.05320.01
7.0.60.0530.06319.98
7.0.50.0700.07720.27
7.0.40.0200.07720.09
7.0.30.0100.06320.07
7.0.20.0200.07320.14
7.0.10.0070.06020.07
7.0.00.0170.08020.07
5.6.280.0070.07020.91
5.6.230.0070.06720.69
5.6.220.0130.05020.71
5.6.210.0100.07320.75
5.6.200.0100.05720.96
5.6.190.0030.07320.97
5.6.180.0070.08721.11
5.6.170.0070.07721.12
5.6.160.0070.07321.02
5.6.150.0130.07720.94
5.6.140.0130.05720.95
5.6.130.0000.05720.96
5.6.120.0000.06020.94
5.6.110.0130.06021.16
5.6.100.0100.08321.04
5.6.90.0030.09021.07
5.6.80.0030.08320.48
5.6.70.0070.05320.49
5.6.60.0000.04720.38
5.6.50.0000.06720.50
5.6.40.0030.06020.36
5.6.30.0070.07320.47
5.6.20.0170.07020.32
5.6.10.0030.08720.33
5.6.00.0030.07720.45
5.5.370.0070.05020.57
5.5.360.0100.03720.36
5.5.350.0170.07320.46
5.5.340.0070.06720.73
5.5.330.0070.05320.91
5.5.320.0030.04020.65
5.5.310.0170.07720.74
5.5.300.0130.07320.88
5.5.290.0130.07720.93
5.5.280.0130.05320.65
5.5.270.0070.05020.64
5.5.260.0130.04720.88
5.5.250.0170.07020.68
5.5.240.0100.07320.15
5.5.230.0070.05320.02
5.5.220.0130.06320.16
5.5.210.0100.07020.27
5.5.200.0030.05720.19
5.5.190.0200.06320.26
5.5.180.0200.06720.17
5.5.160.0100.07020.16
5.5.150.0030.05320.13
5.5.140.0130.04020.24
5.5.130.0100.07320.30
5.5.120.0070.08020.13
5.5.110.0100.07720.13
5.5.100.0170.07319.96
5.5.90.0130.07320.11
5.5.80.0000.08319.95
5.5.70.0100.07320.09
5.5.60.0030.06320.16
5.5.50.0030.08020.16
5.5.40.0130.04719.96
5.5.30.0130.07019.99
5.5.20.0000.05720.09
5.5.10.0170.06320.11
5.5.00.0100.05320.13
5.4.450.0030.05719.56
5.4.440.0070.04319.36
5.4.430.0070.07319.55
5.4.420.0130.07719.35
5.4.410.0070.04319.36
5.4.400.0130.07019.10
5.4.390.0100.07719.04
5.4.380.0070.08018.96
5.4.370.0230.06019.22
5.4.360.0070.07319.13
5.4.350.0070.07719.03
5.4.340.0070.05719.04
5.4.320.0030.04318.91
5.4.310.0070.04319.10
5.4.300.0000.05719.12
5.4.290.0030.04019.05
5.4.280.0070.07719.15
5.4.270.0030.07319.12
5.4.260.0170.07019.23
5.4.250.0030.04719.04
5.4.240.0170.07018.84
5.4.230.0070.07718.94
5.4.220.0070.05719.11
5.4.210.0100.06719.04
5.4.200.0100.07319.20
5.4.190.0030.04319.17
5.4.180.0030.05319.02
5.4.170.0030.06318.84
5.4.160.0000.08319.02
5.4.150.0100.07718.88
5.4.140.0130.06716.50
5.4.130.0070.07316.34
5.4.120.0000.05316.40
5.4.110.0130.06016.50
5.4.100.0100.04016.51
5.4.90.0170.06716.51
5.4.80.0030.07016.34
5.4.70.0070.05316.47
5.4.60.0130.06316.32
5.4.50.0130.06716.36
5.4.40.0000.05316.45
5.4.30.0100.07316.36
5.4.20.0100.07016.39
5.4.10.0170.05316.29
5.4.00.0100.07315.86
5.3.290.0030.05014.73
5.3.280.0070.05714.53
5.3.270.0170.05014.54
5.3.260.0100.06014.62
5.3.250.0030.07314.76
5.3.240.0030.06014.73
5.3.230.0030.07314.74
5.3.220.0000.08314.59
5.3.210.0070.07314.55
5.3.200.0030.07014.59
5.3.190.0100.07314.57
5.3.180.0200.07014.69
5.3.170.0070.08014.59
5.3.160.0100.07314.50
5.3.150.0030.04714.68
5.3.140.0070.06714.59
5.3.130.0130.07014.62
5.3.120.0030.07314.56
5.3.110.0070.07714.66
5.3.100.0100.07714.03
5.3.90.0030.07714.01
5.3.80.0000.05014.14
5.3.70.0000.07713.95
5.3.60.0070.03714.07
5.3.50.0000.07014.09
5.3.40.0130.07013.97
5.3.30.0030.07313.90
5.3.20.0100.06713.59
5.3.10.0100.04713.71
5.3.00.0070.07313.56
5.2.170.0070.06311.70
5.2.160.0200.04711.70
5.2.150.0030.04311.70
5.2.140.0030.06711.70
5.2.130.0030.06711.70
5.2.120.0070.06011.70
5.2.110.0030.05711.70
5.2.100.0030.06011.70
5.2.90.0030.06311.70
5.2.80.0030.06711.70
5.2.70.0030.07311.70
5.2.60.0100.05711.70
5.2.50.0030.06311.70
5.2.40.0000.05711.70
5.2.30.0070.05711.70
5.2.20.0000.04311.70
5.2.10.0030.06311.70
5.2.00.0000.06311.70
5.1.60.0070.05311.70
5.1.50.0030.04311.70
5.1.40.0100.04311.70
5.1.30.0100.05711.70
5.1.20.0070.04711.70
5.1.10.0030.05011.70
5.1.00.0070.05711.70
5.0.50.0030.03311.70
5.0.40.0000.04311.70
5.0.30.0000.06711.70
5.0.20.0030.04311.70
5.0.10.0030.04711.70
5.0.00.0030.05711.70
4.4.90.0070.03011.70
4.4.80.0000.03011.70
4.4.70.0100.02711.70
4.4.60.0070.03311.70
4.4.50.0000.04011.70
4.4.40.0070.04711.70
4.4.30.0030.03311.70
4.4.20.0070.03011.70
4.4.10.0030.03311.70
4.4.00.0030.05311.70
4.3.110.0000.03711.70
4.3.100.0030.02311.70
4.3.90.0070.03011.70
4.3.80.0000.06011.70
4.3.70.0100.02011.70
4.3.60.0030.02711.70
4.3.50.0030.02711.70
4.3.40.0030.05311.70
4.3.30.0030.02711.70
4.3.20.0000.03711.70
4.3.10.0000.03311.70
4.3.00.0030.03311.70

preferences:
48.06 ms | 401 KiB | 5 Q