3v4l.org

run code in 300+ PHP versions simultaneously
<?php printf("test.php: php %s, phar-api %s\n", PHP_VERSION, PharData::apiVersion()); class Metrics { public $steps = array(); public function emit($what, $usage) { static $prev; static $beat = 0; if ($prev) { $this->steps[$beat] = $usage - $prev; } printf("[%s %05d] %s: %s\n", PHP_VERSION, ++$beat, $what, $prev ? sprintf('%d %+d', $usage, $usage - $prev): $usage); $prev = $usage; } public function tick($what) { $this->emit($what, memory_get_usage()); } public function summary() { $steps = $this->steps; $count = count($steps); $steps[] = null; for ($i = 1; $i < $count;) { $v = $steps[$i]; for ($j = $i + 1; $j <= $count; $j++) { $w = $steps[$j]; if ($w !== $v) { $c = $i === $j - 1 ? 1 : $j - $i; $cc[$v] = (isset($cc[$v]) ? $cc[$v] : 0) + $c; printf( "%-8s %-2s %+d %d\n", 1 === $c ? $i : sprintf('%d-%d', $i, $j - 1), 1 === $c ? '' : $j - $i, $v, $cc[$v] ); $i = $j; break; } } } } } $metrics = new Metrics(); $metrics->tick('start'); function phar_tick() { static $i = 0; $path = sprintf('%s/%d.tar', sys_get_temp_dir(), $i); # new filesnames each: https://3v4l.org/lGa2n $phar = new PharData($path); $phar->addEmptyDir('test'); unset($phar); unlink($path); } for ($i = 0; $i < 100; $i++) { phar_tick(); $metrics->tick('after'); } gc_collect_cycles(); $metrics->tick('end'); $metrics->summary();

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.0.30.0271.96916.88
8.0.20.0271.96616.98
8.0.10.0171.97017.00
8.0.00.0311.96617.04
7.4.160.0321.96116.55
7.4.150.0261.96916.55
7.4.140.0331.93816.48
7.4.130.0211.97916.49
7.4.120.0341.95816.49
7.4.110.0341.96016.45
7.4.100.0281.96516.58
7.4.90.0281.97116.52
7.4.80.0241.97716.42
7.4.70.0211.98616.54
7.4.60.0321.97316.50
7.4.50.0331.95616.34
7.4.40.0331.96616.35
7.4.30.0221.97716.43
7.4.20.0291.96916.45
7.4.10.0291.96616.43
7.4.00.0311.96616.46
7.3.280.0281.96516.31
7.3.270.0301.88916.35
7.3.260.0361.95216.39
7.3.250.0201.97516.36
7.3.240.0321.95416.41
7.3.230.0201.97516.40
7.3.220.0371.95016.31
7.3.210.0251.97216.35
7.3.200.0321.96016.26
7.3.190.0251.97816.29
7.3.180.0331.95816.38
7.3.170.0201.97816.30
7.3.160.0301.96816.32
7.3.150.0281.96816.31
7.3.140.0311.96916.35
7.3.130.0271.96916.28
7.3.120.0251.97316.28
7.3.110.0211.98316.32
7.3.100.0271.96816.26
7.3.90.0311.97216.53
7.3.80.0391.94516.33
7.3.70.0351.97416.35
7.3.60.0291.96716.41
7.3.50.0241.97016.39
7.3.40.0361.95516.44
7.3.30.0251.96916.38
7.3.20.0391.95217.08
7.3.10.0381.96516.99
7.3.00.0341.96317.60
7.2.340.0391.95916.55
7.2.330.0331.96416.53
7.2.320.0421.95316.52
7.2.310.0501.93516.49
7.2.300.0351.96316.53
7.2.290.0441.95916.54
7.2.280.0281.98116.46
7.2.270.0311.97616.50
7.2.260.0411.95916.51
7.2.250.0341.96316.49
7.2.240.0471.93416.52
7.2.230.0361.96616.49
7.2.220.0401.94316.44
7.2.210.0371.96216.50
7.2.200.0431.96116.67
7.2.190.0451.95316.57
7.2.180.0391.96416.55
7.2.170.0311.96316.63
7.2.160.0361.95916.64
7.2.150.0321.96716.69
7.2.140.0441.94216.71
7.2.130.0391.96317.65
7.2.120.0391.95317.62
7.2.110.0491.94717.56
7.2.100.0431.96217.65
7.2.90.0501.94917.53
7.2.80.0391.96017.59
7.2.70.0411.96017.57
7.2.60.0461.94817.58
7.2.50.0381.95217.53
7.2.40.0341.95817.59
7.2.30.0421.95317.62
7.2.20.0311.96317.69
7.2.10.0281.97217.59
7.2.00.0381.96217.61
7.1.330.0351.96515.68
7.1.320.0371.96515.58
7.1.310.0411.96215.62
7.1.300.0411.96915.65
7.1.290.0411.96015.64
7.1.280.0311.95715.65
7.1.270.0291.97315.59
7.1.260.0361.95815.64
7.1.250.0451.95116.38
7.1.240.0391.95316.40
7.1.230.0281.97216.51
7.1.220.0361.96416.51
7.1.210.0351.96716.49
7.1.200.0331.97316.44
7.1.190.0381.96016.54
7.1.180.0421.96116.38
7.1.170.0291.96516.48
7.1.160.0391.95516.44
7.1.150.0391.94816.42
7.1.140.0281.96916.42
7.1.130.0301.96916.45
7.1.120.0411.95216.42
7.1.110.0441.95816.41
7.1.100.0521.95216.45
7.1.90.0461.95316.42
7.1.80.0411.96616.49
7.1.70.0251.97716.38
7.1.60.0461.93916.51
7.1.50.0351.92616.54
7.1.40.0331.95716.59
7.1.30.0381.96016.42
7.1.20.0341.96816.38
7.1.10.0271.98016.50
7.1.00.0261.98115.48
7.0.330.0551.95016.32
7.0.320.0281.97316.31
7.0.310.0491.94316.29
7.0.300.0361.96216.21
7.0.290.0431.95916.21
7.0.280.0401.94716.28
7.0.270.0391.96516.29
7.0.260.0361.96516.30
7.0.250.0291.97916.40
7.0.240.0201.98416.36
7.0.230.0371.95716.31
7.0.220.0471.95516.29
7.0.210.0381.96516.22
7.0.200.0401.90316.32
7.0.190.0281.97816.20
7.0.180.0621.93416.27
7.0.170.0491.95216.40
7.0.160.0181.98516.31
7.0.150.0391.96215.29
7.0.140.0441.95415.32
7.0.130.0391.95615.41
7.0.120.0301.97015.46
7.0.110.0311.96615.41
7.0.100.0411.95915.34
7.0.90.0481.95415.29
7.0.80.0411.95915.28
7.0.70.0381.96515.29
7.0.60.0411.95815.41
7.0.50.0331.97715.32
7.0.40.0441.96215.44
7.0.30.0261.98115.41
7.0.20.0291.97815.33
7.0.10.0361.96515.36
7.0.00.0371.95915.30
5.6.400.0381.96116.19
5.6.390.0391.96716.05
5.6.380.0341.96516.12
5.6.370.0291.96916.08
5.6.360.0361.96116.10
5.6.350.0411.95216.06
5.6.340.0391.95416.08
5.6.330.0371.95616.15
5.6.320.0441.95416.09
5.6.310.0331.96416.05
5.6.300.0421.95615.99
5.6.290.0281.97216.14
5.6.280.0281.97416.09
5.6.270.0381.96716.13
5.6.260.0361.97216.09
5.6.250.0311.97116.02
5.6.240.0401.95916.10
5.6.230.0261.97516.22
5.6.220.0331.97116.20
5.6.210.0351.97416.19
5.6.200.0421.95616.18
5.6.190.0381.96016.13
5.6.180.0371.96116.17
5.6.170.0311.97216.23
5.6.160.0341.96116.28
5.6.150.0441.95516.11
5.6.140.0341.96516.08
5.6.130.0281.97016.19
5.6.120.0491.94716.10
5.6.110.0441.94016.10
5.6.100.0491.94416.13
5.6.90.0401.94015.97
5.6.80.0341.95516.01
5.6.70.0361.95116.18
5.6.60.0281.96316.11
5.6.50.0381.95916.11
5.6.40.0491.95516.19
5.6.30.0331.95916.09
5.6.20.0341.96416.13
5.6.10.0431.95316.05
5.6.00.0421.95816.00
5.5.380.0411.95316.26
5.5.370.0261.97316.23
5.5.360.0281.97716.13
5.5.350.0471.95515.98
5.5.340.0421.95815.98
5.5.330.0471.94216.01
5.5.320.0441.96016.08
5.5.310.0361.97515.98
5.5.300.0381.97216.04
5.5.290.0431.96115.94
5.5.280.0261.96715.97
5.5.270.0351.96015.96
5.5.260.0441.93016.10
5.5.250.0311.95416.11
5.5.240.0291.95516.21
5.5.230.0311.96616.12
5.5.220.0341.96516.13
5.5.210.0261.97016.16
5.5.200.0371.96316.04
5.5.190.0351.96316.01
5.5.180.0311.96916.16
5.5.170.0331.97716.00
5.5.160.0281.97115.96
5.5.150.0451.94415.90
5.5.140.0301.96015.82
5.5.130.0311.97515.81
5.5.120.0341.96815.96
5.5.110.0391.95115.91
5.5.100.0331.96816.07
5.5.90.0361.95816.07
5.5.80.0391.96116.08
5.5.70.0361.96816.17
5.5.60.0361.96416.08
5.5.50.0361.96616.03
5.5.40.0341.96816.10
5.5.30.0201.98616.05
5.5.20.0341.96816.07
5.5.10.0401.96415.97
5.5.00.0521.94715.97
5.4.450.0401.95212.79
5.4.440.0291.95712.88
5.4.430.0291.97212.87
5.4.420.0351.96412.84
5.4.410.0341.96712.92
5.4.400.0261.96412.77
5.4.390.0281.96212.81
5.4.380.0261.95812.79
5.4.370.0311.96812.78
5.4.360.0371.95212.76
5.4.350.0261.97512.79
5.4.340.0241.97812.78
5.4.330.0331.96612.80
5.4.320.0291.96612.85
5.4.310.0271.97412.79
5.4.300.0291.96312.77
5.4.290.0261.97112.77
5.4.280.0321.95812.82
5.4.270.0411.95312.76
5.4.260.0361.96012.73
5.4.250.0241.97112.70
5.4.240.0281.97112.75
5.4.230.0231.97412.61
5.4.220.0291.96412.61
5.4.210.0391.95612.61
5.4.200.0241.97112.59
5.4.190.0231.97312.59
5.4.180.0211.97412.56
5.4.170.0241.97212.66
5.4.160.0281.97312.71
5.4.150.0331.96012.76
5.4.140.0321.96712.89
5.4.130.0211.97812.94
5.4.120.0181.98112.84
5.4.110.0221.97312.87
5.4.100.0291.96612.92
5.4.90.0381.96812.86
5.4.80.0301.93712.93
5.4.70.0291.97813.02
5.4.60.0291.97012.97
5.4.50.0211.97712.89
5.4.40.0321.96212.80
5.4.30.0301.96512.87
5.4.20.0161.98412.82
5.4.10.0191.98112.87
5.4.00.0311.97312.56
5.3.290.0511.94713.05
5.3.280.0351.97112.93
5.3.270.0231.98813.04
5.3.260.0241.97713.05
5.3.250.0281.96912.95
5.3.240.0281.97512.83
5.3.230.0241.97112.89
5.3.220.0291.96512.90
5.3.210.0211.97512.89
5.3.200.0351.96812.85
5.3.190.0211.98012.96
5.3.180.0401.95013.07
5.3.170.0251.97413.05
5.3.160.0271.97413.00
5.3.150.0231.97313.03
5.3.140.0281.98512.92
5.3.130.0201.98112.94
5.3.120.0281.96612.92
5.3.110.0191.98312.93
5.3.100.0441.95513.01
5.3.90.0361.96813.03
5.3.80.0111.99412.94
5.3.70.0281.97012.88
5.3.60.0231.97912.91
5.3.50.0161.98312.93
5.3.40.0291.96812.83
5.3.30.0321.93112.89
5.3.20.0461.92012.88
5.3.10.0191.97312.70
5.3.00.0181.97512.67
5.2.170.0100.00711.92
5.2.160.0110.00511.89
5.2.150.0130.00412.01
5.2.140.0080.00712.09
5.2.130.0100.00511.74
5.2.120.0140.00211.83
5.2.110.0090.00611.81
5.2.100.0130.00511.94
5.2.90.0100.00411.82
5.2.80.0140.00411.69
5.2.70.0090.00611.78
5.2.60.0100.00711.69
5.2.50.0080.00911.80
5.2.40.0100.00611.79
5.2.30.0100.00711.79
5.2.20.0130.00411.57
5.2.10.0110.00411.63
5.2.00.0100.00511.38
5.1.60.0080.00711.11
5.1.50.0070.00711.11
5.1.40.0060.00811.11
5.1.30.0120.00511.19
5.1.20.0060.00811.11
5.1.10.0110.00611.16
5.1.00.0080.00811.11
5.0.50.0060.00511.11
5.0.40.0100.00211.11
5.0.30.0080.00511.11
5.0.20.0070.00811.11
5.0.10.0090.00611.11
5.0.00.0060.00811.11
4.4.90.0070.00311.11
4.4.80.0050.00311.11
4.4.70.0050.00311.11
4.4.60.0050.00411.11
4.4.50.0090.00111.11
4.4.40.0020.00611.11
4.4.30.0040.00411.11
4.4.20.0070.00211.11
4.4.10.0060.00211.11
4.4.00.0070.00111.11
4.3.110.0050.00211.11
4.3.100.0060.00211.11
4.3.90.0050.00411.11
4.3.80.0070.00011.11
4.3.70.0030.00711.11
4.3.60.0030.00511.11
4.3.50.0070.00211.11
4.3.40.0020.00611.11
4.3.30.0020.00411.11
4.3.20.0050.00311.11
4.3.10.0040.00211.11
4.3.00.0050.00211.11

preferences:
33.33 ms | 401 KiB | 5 Q