3v4l.org

run code in 300+ PHP versions simultaneously
<?php $entries = []; for($i = 0; $i < 100000; $i++) { $entries[] = ['id' => $i]; } $t = microtime(true); $res = array_map(function($entry) { return $entry['id']; }, $entries); $t = microtime(true) - $t; echo 'array_map() took ' . number_format($t, 3) . ' seconds'; $t = microtime(true); $res = []; foreach($entries as $entry) { $res[] = $entry['id']; } $t = microtime(true) - $t; echo "\n"; echo 'foreach took ' . number_format($t, 3) . ' seconds';

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)
7.4.10.0330.05060.88
7.4.00.0200.05960.77
7.3.130.0360.05560.39
7.3.120.0370.06760.59
7.3.110.0240.04460.64
7.3.100.0290.05260.25
7.3.90.0290.05260.48
7.3.80.0380.04160.32
7.3.70.0430.05360.42
7.3.60.0330.05660.35
7.3.50.0290.05660.61
7.3.40.0170.06360.60
7.3.30.0360.03660.50
7.3.20.0170.03764.10
7.3.10.0130.03464.31
7.3.00.0170.04764.34
7.2.260.0200.06360.84
7.2.250.0500.05660.94
7.2.240.0430.03660.91
7.2.230.0390.06260.80
7.2.220.0210.05460.50
7.2.210.0230.04760.96
7.2.200.0340.07260.84
7.2.190.0300.06660.91
7.2.180.0270.04760.75
7.2.170.0200.05360.68
7.2.160.0270.04660.86
7.2.150.0330.03364.70
7.2.140.0070.04364.45
7.2.130.0340.04164.55
7.2.120.0140.03564.64
7.2.110.0330.04764.35
7.2.100.0360.04364.52
7.2.90.0150.04264.50
7.2.80.0170.04164.66
7.2.70.0170.03364.56
7.2.60.0180.04764.48
7.2.50.0230.03764.53
7.2.40.0250.04364.57
7.2.30.0210.05264.51
7.2.20.0290.04564.88
7.2.10.0210.05364.66
7.2.00.0150.04565.00
7.1.330.0070.05163.45
7.1.320.0160.05363.56
7.1.310.0250.05363.65
7.1.300.0070.04463.50
7.1.290.0260.04963.50
7.1.280.0100.04763.75
7.1.270.0290.04563.46
7.1.260.0140.05463.54
7.1.250.0100.05563.61
7.1.240.0260.05063.40
7.1.230.0130.06863.64
7.1.220.0200.04763.63
7.1.210.0300.04363.56
7.1.200.0210.04463.43
7.1.190.0110.06263.58
7.1.180.0140.06563.56
7.1.170.0210.04563.59
7.1.160.0240.05163.46
7.1.150.0220.04963.65
7.1.140.0320.04363.61
7.1.130.0250.05663.46
7.1.120.0250.05163.56
7.1.110.0280.05263.57
7.1.100.0290.05263.48
7.1.90.0180.06263.50
7.1.80.0200.04363.47
7.1.70.0180.03963.30
7.1.60.0200.04563.67
7.1.50.0310.03448.27
7.1.40.0210.05663.65
7.1.30.0290.05063.63
7.1.20.0150.00613.09
7.1.10.0230.06063.52
7.1.00.0120.06040.77
7.0.330.0260.05363.13
7.0.320.3220.05663.14
7.0.310.0160.05263.24
7.0.300.0340.04063.31
7.0.290.0200.05663.17
7.0.280.0220.04863.18
7.0.270.0160.05563.32
7.0.260.0220.05863.18
7.0.250.0220.05463.19
7.0.240.0190.05963.38
7.0.230.0200.05263.17
7.0.220.0270.04863.42
7.0.210.0200.06463.30
7.0.200.1060.04761.46
7.0.190.0270.05763.30
7.0.180.0210.05263.37
7.0.170.0330.04763.29
7.0.160.0200.06963.21
7.0.150.0140.00713.09
7.0.140.0130.05740.67
7.0.130.0140.06063.38
7.0.120.0200.00013.09
7.0.110.0260.05463.30
7.0.100.0110.01113.09
7.0.90.0260.05163.32
7.0.80.0330.03963.36
7.0.70.0170.06463.14
7.0.60.0260.09563.77
7.0.50.0280.07962.67
7.0.40.0220.09026.22
7.0.30.0350.08126.16
7.0.20.0480.06626.11
7.0.10.0250.07426.13
7.0.00.0220.09026.14
5.6.400.0400.19579.25
5.6.390.0390.16878.98
5.6.380.0490.15479.23
5.6.370.0490.16878.67
5.6.360.0600.16679.01
5.6.350.0320.18079.05
5.6.340.0590.16179.06
5.6.330.0160.00413.09
5.6.320.0620.14478.79
5.6.310.0470.16479.06
5.6.300.0600.15078.46
5.6.290.0480.16478.98
5.6.280.0320.18881.59
5.6.270.0570.15579.05
5.6.260.0480.18678.89
5.6.250.0530.16678.75
5.6.240.0600.15378.84
5.6.230.0430.17778.91
5.6.220.0430.17379.09
5.6.210.0400.17781.23
5.6.200.0310.18879.96
5.6.190.0440.17381.20
5.6.180.0550.16681.18
5.6.170.0420.17981.08
5.6.160.0490.18081.12
5.6.150.0390.18180.14
5.6.140.0370.18179.98
5.6.130.0400.19480.03
5.6.120.0450.16881.54
5.6.110.0550.19781.45
5.6.100.0380.19681.48
5.6.90.0320.18481.48
5.6.80.0310.17781.19
5.6.70.0400.17081.17
5.6.60.0470.14479.06
5.6.50.0390.16578.65
5.6.40.0330.16878.67
5.6.30.0260.18078.98
5.6.20.0600.14978.76
5.6.10.0390.16479.02
5.6.00.0400.17978.74
5.5.380.0510.16579.05
5.5.370.0520.15678.83
5.5.360.0300.18878.91
5.5.350.0490.16781.10
5.5.340.0510.18479.79
5.5.330.0420.18680.96
5.5.320.0640.16381.02
5.5.310.0340.16981.03
5.5.300.0430.15379.92
5.5.290.0420.19279.93
5.5.280.0260.15581.35
5.5.270.0340.19081.17
5.5.260.0610.17781.32
5.5.250.0370.18881.24
5.5.240.0470.17881.00
5.5.230.0590.16778.71
5.5.220.0720.16078.77
5.5.210.0310.18078.70
5.5.200.0530.17778.87
5.5.190.0560.17278.94
5.5.180.0600.14978.96
5.5.170.0430.14978.95
5.5.160.0310.20478.74
5.5.150.0560.19979.05
5.5.140.0410.16278.84
5.5.130.0610.14078.85
5.5.120.0510.17278.93
5.5.110.0540.16378.86
5.5.100.0460.16178.72
5.5.90.0500.17278.54
5.5.80.0330.18978.93
5.5.70.0650.15978.80
5.5.60.0460.19478.79
5.5.50.0400.18378.88
5.5.40.0370.19678.67
5.5.30.0370.17978.52
5.5.20.0450.16778.89
5.5.10.0200.18978.82
5.5.00.0490.17078.57
5.4.450.0560.16279.05
5.4.440.0420.17578.89
5.4.430.0370.20578.87
5.4.420.0630.19479.01
5.4.410.0400.17778.87
5.4.400.0480.18378.76
5.4.390.0490.19978.79
5.4.380.0630.22178.58
5.4.370.0750.19078.65
5.4.360.0820.19078.74
5.4.350.0760.19278.52
5.4.340.0600.21378.66
5.4.330.0500.17275.64
5.4.320.0370.18075.63
5.4.310.0330.18375.54
5.4.300.0320.15075.60
5.4.290.0310.15175.52
5.4.280.0290.15375.36
5.4.270.0320.17675.44
5.4.260.0350.16175.48
5.4.250.0330.18075.54
5.4.240.0290.15975.56
5.4.230.0340.17175.48
5.4.220.0370.17475.40
5.4.210.0250.17575.44
5.4.200.0310.16175.52
5.4.190.0300.16575.55
5.4.180.0290.16475.47
5.4.170.0360.16175.57
5.4.160.0360.15475.56
5.4.150.0390.15675.38
5.4.140.0250.17675.27
5.4.130.0280.16275.36
5.4.120.0220.17775.23
5.4.110.0460.14875.31
5.4.100.0260.17175.27
5.4.90.0360.17275.36
5.4.80.0290.17775.30
5.4.70.0240.17075.26
5.4.60.0420.15975.29
5.4.50.0300.17075.38
5.4.40.0270.21075.31
5.4.30.0370.16575.25
5.4.20.0400.17175.21
5.4.10.0270.16475.38
5.4.00.0330.16075.00
5.3.290.0040.04112.80
5.3.280.0030.04012.71
5.3.270.0060.03912.72
5.3.260.0080.04512.71
5.3.250.0110.03812.72
5.3.240.0050.05412.72
5.3.230.0050.04012.71
5.3.220.0050.03912.68
5.3.210.0060.04112.68
5.3.200.0080.03712.68
5.3.190.0070.03712.68
5.3.180.0060.03912.67
5.3.170.0050.03912.67
5.3.160.0050.03812.67
5.3.150.0030.04012.67
5.3.140.0080.03512.66
5.3.130.0050.04012.65
5.3.120.0070.05012.66
5.3.110.0050.04012.66
5.3.100.0050.03912.12
5.3.90.0070.03512.08
5.3.80.0060.03912.08
5.3.70.0050.03712.07
5.3.60.0070.04112.07
5.3.50.0040.03912.00
5.3.40.0040.03812.00
5.3.30.0050.03511.95
5.3.20.0040.03611.73
5.3.10.0060.03411.70
5.3.00.0080.03311.68
5.2.170.0030.0329.18
5.2.160.0050.0289.18
5.2.150.0040.0319.18
5.2.140.0030.0329.17
5.2.130.0030.0309.14
5.2.120.0040.0299.14
5.2.110.0020.0319.14
5.2.100.0030.0299.14
5.2.90.0060.0279.14
5.2.80.0040.0309.14
5.2.70.0040.0309.14
5.2.60.0060.0289.09
5.2.50.0060.0289.06
5.2.40.0040.0299.03
5.2.30.0060.0289.02
5.2.20.0050.0289.00
5.2.10.0040.0298.93
5.2.00.0060.0278.79
5.1.60.0040.0248.06
5.1.50.0040.0258.06
5.1.40.0080.0208.04
5.1.30.0070.0238.39
5.1.20.0020.0298.42
5.1.10.0040.0268.14
5.1.00.0040.0258.14
5.0.50.0050.0186.63
5.0.40.0040.0196.48
5.0.30.0010.0336.30
5.0.20.0050.0196.27
5.0.10.0030.0206.24
5.0.00.0050.0296.23
4.4.90.0020.0164.78
4.4.80.0050.0134.75
4.4.70.0030.0164.75
4.4.60.0030.0154.76
4.4.50.0050.0124.77
4.4.40.0040.0234.70
4.4.30.0000.0184.76
4.4.20.0040.0144.85
4.4.10.0010.0174.85
4.4.00.0030.0244.76
4.3.110.0040.0144.66
4.3.100.0020.0154.66
4.3.90.0030.0164.63
4.3.80.0020.0244.58
4.3.70.0040.0124.63
4.3.60.0030.0144.63
4.3.50.0020.0164.63
4.3.40.0030.0244.54
4.3.30.0030.0153.29
4.3.20.0020.0163.26
4.3.10.0040.0143.22
4.3.00.0070.01715.68

preferences:
40.01 ms | 401 KiB | 5 Q