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); $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.0420.02417.43
8.0.20.0400.02217.50
8.0.10.0360.03117.62
8.0.00.0550.01717.58
7.4.160.0420.03817.13
7.4.150.0350.02517.04
7.4.140.0380.02917.03
7.4.130.0470.02217.07
7.4.120.0380.03017.01
7.4.110.0380.02416.98
7.4.100.0370.02417.06
7.4.90.0390.02717.07
7.4.80.0340.03616.97
7.4.70.0390.02616.95
7.4.60.0470.01717.07
7.4.50.0320.02816.94
7.4.40.0290.03516.92
7.4.30.0410.02916.98
7.4.20.0380.02516.99
7.4.10.0390.02617.00
7.4.00.0290.02617.12
7.3.280.0440.03416.99
7.3.270.0450.01616.89
7.3.260.0330.03216.93
7.3.250.0450.02316.95
7.3.240.0430.02716.90
7.3.230.0330.02416.93
7.3.220.0370.02316.79
7.3.210.0330.03116.89
7.3.200.0440.01616.90
7.3.190.0380.02016.86
7.3.180.0430.02016.85
7.3.170.0470.03316.87
7.3.160.0380.02116.88
7.3.150.0470.03216.87
7.3.140.0360.03316.84
7.3.130.0340.02916.88
7.3.120.0340.03416.92
7.3.110.0490.02516.79
7.3.100.0440.02016.82
7.3.90.0350.02417.08
7.3.80.0380.02816.91
7.3.70.0510.02816.94
7.3.60.0350.02516.98
7.3.50.0400.02816.98
7.3.40.0460.01516.98
7.3.30.0450.02116.93
7.3.20.0420.02217.69
7.3.10.0430.02817.59
7.3.00.0460.01917.54
7.2.340.0310.03817.02
7.2.330.0580.02417.04
7.2.320.0640.02017.02
7.2.310.0450.02216.98
7.2.300.0440.01716.93
7.2.290.0420.04216.93
7.2.280.0470.02517.07
7.2.270.0540.01716.97
7.2.260.0470.02017.00
7.2.250.0520.03917.04
7.2.240.0540.01717.07
7.2.230.0430.03316.99
7.2.220.0350.03417.02
7.2.210.0410.02717.00
7.2.200.0520.02917.20
7.2.190.0520.01417.08
7.2.180.0560.01916.98
7.2.170.0610.00817.15
7.2.160.0610.01617.14
7.2.150.0500.02918.39
7.2.140.0520.03518.52
7.2.130.0550.01218.63
7.2.120.0540.03518.52
7.2.110.0600.01918.60
7.2.100.0470.03918.56
7.2.90.0510.01818.49
7.2.80.0650.01818.53
7.2.70.0410.02918.48
7.2.60.0420.03618.47
7.2.50.0520.03518.55
7.2.40.0500.02218.46
7.2.30.0570.02417.23
7.2.20.0330.03717.24
7.2.10.0630.02917.20
7.2.00.0470.02217.31
7.1.330.0560.02316.11
7.1.320.0460.02116.16
7.1.310.0540.03416.16
7.1.300.0440.01816.13
7.1.290.0400.02116.07
7.1.280.0380.02717.40
7.1.270.0460.02017.40
7.1.260.0440.02717.45
7.1.250.0440.02717.21
7.1.240.0530.02217.25
7.1.230.0460.03117.41
7.1.220.0540.03217.33
7.1.210.0500.02517.40
7.1.200.0420.02117.34
7.1.190.0580.02717.28
7.1.180.0430.03117.31
7.1.170.0450.02917.35
7.1.160.0490.01917.38
7.1.150.0610.01616.00
7.1.140.0590.01716.00
7.1.130.0520.02316.04
7.1.120.0520.01416.04
7.1.110.0500.03516.02
7.1.100.0530.02615.98
7.1.90.0460.02016.01
7.1.80.0490.03216.04
7.1.70.0640.01515.94
7.1.60.0400.03116.12
7.1.50.0460.01816.05
7.1.40.0510.03116.05
7.1.30.0400.03016.07
7.1.20.0610.02516.11
7.1.10.0470.01916.12
7.1.00.0400.02715.95
7.0.330.0540.00717.08
7.0.320.0700.01817.13
7.0.310.0470.02217.26
7.0.300.0490.03017.13
7.0.290.0490.02417.10
7.0.280.0610.01715.88
7.0.270.0430.03615.90
7.0.260.0620.01615.80
7.0.250.0490.02815.95
7.0.240.0540.02415.81
7.0.230.0630.03015.98
7.0.220.0590.01715.82
7.0.210.0570.01815.87
7.0.200.0320.02915.86
7.0.190.0490.02215.82
7.0.180.0380.02515.93
7.0.170.0450.01915.95
7.0.160.0370.03315.81
7.0.150.0320.02915.77
7.0.140.0510.02115.82
7.0.130.0460.01815.91
7.0.120.0430.02315.82
7.0.110.0440.02515.81
7.0.100.0350.02615.85
7.0.90.0390.02615.68
7.0.80.0330.03015.78
7.0.70.0530.02115.77
7.0.60.0420.02415.82
7.0.50.0410.02115.77
7.0.40.0520.02615.90
7.0.30.0520.02315.76
7.0.20.0310.03215.67
7.0.10.0380.02515.85
7.0.00.0400.02015.74
5.6.400.0290.03616.39
5.6.390.0400.03016.50
5.6.380.0580.02716.38
5.6.370.0550.02416.41
5.6.360.0520.03816.38
5.6.350.0580.03016.32
5.6.340.0540.03816.36
5.6.330.0420.02616.34
5.6.320.0610.02116.45
5.6.310.0670.02316.32
5.6.300.0430.01816.16
5.6.290.0340.03116.49
5.6.280.0330.03616.44
5.6.270.0510.01016.55
5.6.260.0370.02616.40
5.6.250.0410.02616.41
5.6.240.0390.02716.45
5.6.230.0560.00616.52
5.6.220.0610.03116.49
5.6.210.0380.02916.39
5.6.200.0420.02516.55
5.6.190.0590.02316.45
5.6.180.0320.02916.51
5.6.170.0400.02516.50
5.6.160.0440.01916.48
5.6.150.0380.02416.54
5.6.140.0420.02816.35
5.6.130.0500.01616.44
5.6.120.0380.02716.39
5.6.110.0420.02416.33
5.6.100.0460.03716.29
5.6.90.0350.02616.42
5.6.80.0380.03116.26
5.6.70.0260.03516.42
5.6.60.0340.02716.35
5.6.50.0460.01316.31
5.6.40.0640.02916.47
5.6.30.0500.03216.43
5.6.20.0380.02216.41
5.6.10.0480.01716.21
5.6.00.0380.02416.39
5.5.380.0420.02516.33
5.5.370.0360.02916.42
5.5.360.0400.02816.26
5.5.350.0440.02216.18
5.5.340.0460.02316.41
5.5.330.0400.02316.37
5.5.320.0430.02316.28
5.5.310.0460.03716.39
5.5.300.0410.02616.21
5.5.290.0360.03316.20
5.5.280.0440.03916.30
5.5.270.0660.01716.31
5.5.260.0530.01616.28
5.5.250.0330.03616.41
5.5.240.0360.03016.44
5.5.230.0430.03216.40
5.5.220.0340.03116.29
5.5.210.0470.03416.36
5.5.200.0580.01516.24
5.5.190.0370.02616.20
5.5.180.0410.03316.29
5.5.170.0470.02616.29
5.5.160.0650.02316.29
5.5.150.0500.01316.18
5.5.140.0460.02116.13
5.5.130.0430.02916.07
5.5.120.0460.03116.14
5.5.110.0380.02616.11
5.5.100.0590.04516.52
5.5.90.0410.02916.28
5.5.80.0480.03416.26
5.5.70.0500.02316.31
5.5.60.0360.03416.20
5.5.50.0450.02216.25
5.5.40.0420.03216.25
5.5.30.0390.03216.24
5.5.20.0480.03116.31
5.5.10.0340.03016.28
5.5.00.0580.02816.19
5.4.450.0370.01713.11
5.4.440.0270.01713.14
5.4.430.0240.01713.07
5.4.420.0300.01013.07
5.4.410.0360.00613.07
5.4.400.0220.02913.08
5.4.390.0290.01213.05
5.4.380.0280.00913.04
5.4.370.0230.02013.04
5.4.360.0330.02613.14
5.4.350.0340.01913.13
5.4.340.0180.02513.08
5.4.330.0330.00913.09
5.4.320.0280.01313.19
5.4.310.0290.01313.07
5.4.300.0340.00613.05
5.4.290.0380.01513.08
5.4.280.0190.02313.07
5.4.270.0320.01913.07
5.4.260.0370.01012.92
5.4.250.0340.00612.94
5.4.240.0370.01113.00
5.4.230.0330.03012.89
5.4.220.0340.01012.83
5.4.210.0320.01012.88
5.4.200.0320.02312.89
5.4.190.0330.01812.85
5.4.180.0400.00712.82
5.4.170.0180.02912.95
5.4.160.0400.00913.00
5.4.150.0210.02113.01
5.4.140.0270.02013.05
5.4.130.0270.01513.22
5.4.120.0380.01913.26
5.4.110.0250.01913.21
5.4.100.0340.00913.25
5.4.90.0240.02013.16
5.4.80.0160.02713.16
5.4.70.0350.01913.24
5.4.60.0280.01413.24
5.4.50.0270.01313.03
5.4.40.0190.02613.10
5.4.30.0270.01313.15
5.4.20.0300.02013.09
5.4.10.0300.01713.12
5.4.00.0250.01712.90
5.3.290.0270.01713.48
5.3.280.0360.02013.51
5.3.270.0210.02413.61
5.3.260.0330.01713.63
5.3.250.0360.02013.48
5.3.240.0350.01913.44
5.3.230.0310.02413.38
5.3.220.0290.01513.50
5.3.210.0390.01013.51
5.3.200.0360.01613.52
5.3.190.0240.02013.59
5.3.180.0370.01213.63
5.3.170.0300.01713.63
5.3.160.0290.01813.62
5.3.150.0250.01813.50
5.3.140.0280.01613.56
5.3.130.0260.01613.57
5.3.120.0330.01813.55
5.3.110.0350.02513.45
5.3.100.0310.01113.66
5.3.90.0330.01813.49
5.3.80.0270.02113.37
5.3.70.0310.01813.37
5.3.60.0360.01013.57
5.3.50.0340.01913.35
5.3.40.0220.02513.53
5.3.30.0320.01613.44
5.3.20.0230.02313.36
5.3.10.0260.01613.32
5.3.00.0280.02213.12
5.2.170.0140.00311.86
5.2.160.0080.00912.03
5.2.150.0090.00912.01
5.2.140.0080.00811.87
5.2.130.0100.01011.91
5.2.120.0150.00011.74
5.2.110.0150.01111.80
5.2.100.0050.01111.88
5.2.90.0160.00311.77
5.2.80.0100.01011.87
5.2.70.0150.00611.68
5.2.60.0140.01011.64
5.2.50.0130.00411.79
5.2.40.0080.01111.86
5.2.30.0210.00011.72
5.2.20.0130.00311.73
5.2.10.0060.00911.52
5.2.00.0090.00611.44
5.1.60.0140.00311.11
5.1.50.0120.00211.11
5.1.40.0100.00311.11
5.1.30.0150.00011.11
5.1.20.0040.00911.14
5.1.10.0140.00311.11
5.1.00.0100.00311.11
5.0.50.0050.00911.11
5.0.40.0090.00211.11
5.0.30.0040.00711.11
5.0.20.0080.00411.11
5.0.10.0140.00011.11
5.0.00.0070.00511.11
4.4.90.0110.00011.11
4.4.80.0050.00511.11
4.4.70.0030.00411.11
4.4.60.0000.00711.11
4.4.50.0040.00411.11
4.4.40.0030.00611.11
4.4.30.0050.00311.11
4.4.20.0080.00011.11
4.4.10.0040.00411.11
4.4.00.0060.00311.11
4.3.110.0050.00311.11
4.3.100.0070.00011.11
4.3.90.0050.00211.11
4.3.80.0090.00011.11
4.3.70.0020.00611.11
4.3.60.0070.00011.11
4.3.50.0040.00411.11
4.3.40.0040.00311.11
4.3.30.0030.00611.11
4.3.20.0070.00011.11
4.3.10.0000.00611.11
4.3.00.0030.00311.11

preferences:
25.82 ms | 400 KiB | 5 Q