3v4l.org

run code in 300+ PHP versions simultaneously
<?php $array = [ 'foo', 'bar' ]; function foo($array) { static $index = 0; if (!isset($array[$index])) { return []; } $bar[$array[$index]] = foo($array) and ++$index; return $bar; } foo($array);

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.70.0680.01973.43
8.3.60.0480.01076.11
8.3.50.0820.03273.14
8.3.40.0290.01344.68
8.3.30.0310.01444.67
8.3.20.0130.01046.54
8.3.10.0100.01046.93
8.3.00.0210.00349.06
8.2.190.0540.02772.50
8.2.180.0520.02073.24
8.2.170.0350.01944.72
8.2.160.0180.01148.90
8.2.150.0210.00345.02
8.2.140.0090.00948.18
8.2.130.0120.00946.17
8.2.120.0110.00350.25
8.2.110.0210.00745.33
8.2.100.0160.01643.93
8.2.90.0110.01145.21
8.2.80.0140.01143.38
8.2.70.0110.01543.50
8.2.60.0160.00943.68
8.2.50.0210.00343.63
8.2.40.0160.00646.57
8.2.30.0180.00745.35
8.2.20.0160.01043.65
8.2.10.0130.00743.96
8.2.00.0160.00643.90
8.1.280.0410.02174.02
8.1.270.0480.00747.93
8.1.260.0150.00649.23
8.1.250.0240.00046.21
8.1.240.0300.01347.52
8.1.230.0300.00343.77
8.1.220.0030.02043.65
8.1.210.0160.01043.36
8.1.200.0130.01343.23
8.1.190.0150.00943.23
8.1.180.0110.01143.23
8.1.170.0140.01044.50
8.1.160.0070.01746.72
8.1.150.0130.00745.88
8.1.140.0150.00945.57
8.1.130.0170.00743.66
8.1.120.0130.01043.42
8.1.110.0120.00843.49
8.1.100.0210.00343.54
8.1.90.0060.01343.41
8.1.80.0140.01043.38
8.1.70.0130.00643.50
8.1.60.0130.01343.62
8.1.50.0170.00743.51
8.1.40.0140.01443.56
8.1.30.0170.00743.59
8.1.20.0100.01343.48
8.1.10.0270.01073.30
8.1.00.0300.01373.08
8.0.300.0350.00072.60
8.0.290.0230.01572.38
8.0.280.0200.01373.99
8.0.270.0240.01772.74
8.0.260.0330.01372.85
8.0.250.0390.00372.48
8.0.240.0220.01372.52
8.0.230.0350.00472.54
8.0.220.0240.00772.37
8.0.210.0290.01072.39
8.0.200.0270.01372.45
8.0.190.0140.03072.52
8.0.180.0200.02072.54
8.0.170.0320.01472.37
8.0.160.0180.01872.41
8.0.150.0170.02372.34
8.0.140.0160.02972.31
8.0.130.0800.028121.79
8.0.120.0130.02772.31
8.0.110.0160.02372.41
8.0.100.0300.01372.30
8.0.90.0200.02072.24
8.0.80.0470.03372.46
8.0.70.0100.02772.34
8.0.60.0230.01672.37
8.0.50.0070.03072.40
8.0.30.0350.04472.60
8.0.20.0600.03672.73
8.0.10.0160.02272.55
8.0.00.0580.03372.36
7.4.330.0150.00974.70
7.4.320.0300.00372.10
7.4.300.0170.01771.98
7.4.290.0260.01972.07
7.4.280.0260.01671.85
7.4.270.0280.01372.13
7.4.260.0260.01672.00
7.4.250.0320.00372.10
7.4.240.0170.02471.99
7.4.230.0180.01871.75
7.4.220.0720.02672.20
7.4.210.0470.03472.05
7.4.200.0230.01371.84
7.4.160.0360.05672.01
7.4.150.0790.03272.06
7.4.140.0760.03372.14
7.4.130.0760.03972.14
7.4.120.0630.03171.95
7.4.110.0580.02971.94
7.4.100.0480.04571.95
7.4.90.0560.03072.01
7.4.80.0590.03672.12
7.4.70.0450.03972.11
7.4.60.0730.03672.23
7.4.50.0160.03571.93
7.4.40.0670.02372.11
7.4.30.0380.04872.14
7.4.10.0300.04770.18
7.4.00.0330.03570.51
7.3.330.0490.026121.86
7.3.320.0690.020121.73
7.3.310.0200.01771.91
7.3.300.0190.01671.78
7.3.290.1040.03671.84
7.3.280.0600.04171.82
7.3.270.0590.03272.22
7.3.260.0590.03371.93
7.3.250.0760.03771.81
7.3.240.0650.03071.85
7.3.230.0710.02671.84
7.3.210.0500.04071.97
7.3.200.0620.02671.72
7.3.190.0480.03971.84
7.3.180.0730.01372.08
7.3.170.0620.02871.70
7.3.160.0510.03471.85
7.3.130.0390.01670.22
7.3.120.0420.03370.61
7.3.110.0470.03070.28
7.3.100.0170.03470.38
7.3.90.0200.04370.53
7.3.80.0420.02470.18
7.3.70.0270.02470.28
7.3.60.0390.01670.30
7.3.50.0240.03770.36
7.3.40.0270.03070.34
7.3.30.0210.03170.04
7.3.20.0230.01078.58
7.3.10.0200.01378.51
7.3.00.0130.02378.61
7.2.330.0490.04972.32
7.2.320.0610.06172.29
7.2.310.0740.02072.45
7.2.300.0720.01972.06
7.2.290.0700.02072.28
7.2.260.0450.02970.86
7.2.250.0260.03370.26
7.2.240.0260.02370.81
7.2.230.0270.03670.59
7.2.220.0330.03370.32
7.2.210.0340.02370.60
7.2.200.0270.03370.57
7.2.190.0300.03070.50
7.2.180.0320.02670.39
7.2.170.0300.02470.61
7.2.160.0310.02870.59
7.2.150.0160.02378.83
7.2.140.0060.02678.71
7.2.130.0230.01778.93
7.2.120.0200.01378.86
7.2.110.0210.01878.71
7.2.100.0100.02478.65
7.2.90.0140.02578.51
7.2.80.0160.01978.98
7.2.70.0140.01778.68
7.2.60.2230.02078.70
7.2.50.1180.02078.79
7.2.40.0130.02078.68
7.2.30.0070.02878.77
7.2.20.0120.02178.91
7.2.10.0030.02878.74
7.2.00.0170.02478.42
7.1.330.0130.03077.70
7.1.320.0100.03577.43
7.1.310.0130.03577.68
7.1.300.0190.03277.91
7.1.290.0130.03077.36
7.1.280.0100.03777.73
7.1.270.0170.03777.55
7.1.260.0130.03977.81
7.1.250.0200.03477.71
7.1.240.0100.04977.91
7.1.230.0260.02377.74
7.1.220.0230.02677.35
7.1.210.0190.02977.98
7.1.200.0630.02077.81
7.1.190.0130.03577.79
7.1.180.0260.02677.93
7.1.170.0200.02777.71
7.1.160.0130.02977.98
7.1.150.0100.03477.45
7.1.140.0210.03577.70
7.1.130.0070.04177.67
7.1.120.0100.04077.52
7.1.110.0070.04077.73
7.1.100.0200.03777.63
7.1.90.0160.03577.63
7.1.80.0130.03577.98
7.1.70.0530.02378.46
7.1.60.0240.03578.37
7.1.50.0340.03678.27
7.1.40.0130.05477.74
7.1.30.0380.03877.82
7.1.20.0160.04877.87
7.1.10.0270.03877.71
7.1.00.0180.06780.94
7.0.330.0200.03377.49
7.0.320.0100.04077.47
7.0.310.0200.03077.40
7.0.300.0200.02977.22
7.0.290.0130.03677.30
7.0.280.0100.03677.62
7.0.270.0200.03077.61
7.0.260.1720.04677.07
7.0.250.0160.03677.18
7.0.240.0130.03377.48
7.0.230.0100.03377.54
7.0.220.0220.02877.49
7.0.210.0230.04577.57
7.0.200.2240.03273.93
7.0.190.0320.04677.54
7.0.180.0170.03677.44
7.0.170.2870.04077.30
7.0.160.0200.05677.23
7.0.150.0300.03377.36
7.0.140.0180.04777.55
7.0.130.0260.04077.47
7.0.120.0310.03577.62
7.0.110.0160.04777.41
7.0.100.0260.04077.55
7.0.90.0170.04477.53
7.0.80.0100.05277.24
7.0.70.0150.05277.50
7.0.60.0930.06376.59
7.0.50.0150.05975.50
7.0.40.0080.05616.80
7.0.30.0270.07716.82
7.0.20.0180.06216.79
7.0.10.0200.05016.82
7.0.00.0220.05216.76
5.6.400.0260.05579.27
5.6.390.0410.04179.39
5.6.380.0370.04379.02
5.6.370.0410.03879.18
5.6.360.0470.03078.87
5.6.350.0500.03679.26
5.6.340.0300.05079.04
5.6.330.0300.04478.75
5.6.320.0450.04579.01
5.6.310.0520.05979.35
5.6.300.0350.06078.95
5.6.290.0560.03979.05
5.6.280.0320.07682.34
5.6.270.0410.05879.43
5.6.260.0440.05579.20
5.6.250.0320.06679.17
5.6.240.0590.04279.23
5.6.230.0410.04479.01
5.6.220.0480.04279.02
5.6.210.0370.07782.08
5.6.200.0450.06281.04
5.6.190.0330.09282.16
5.6.180.0540.05781.93
5.6.170.0310.06681.98
5.6.160.0350.06782.09
5.6.150.0420.08281.09
5.6.140.0420.08081.00
5.6.130.0370.05580.82
5.6.120.0410.07882.25
5.6.110.0470.08082.29
5.6.100.0370.07582.44
5.6.90.0340.08782.52
5.6.80.0390.07882.02
5.6.70.0470.04779.00
5.6.60.0570.04779.11
5.6.50.0540.03979.10
5.6.40.0470.04779.03
5.6.30.0380.05779.03
5.6.20.0560.04378.85
5.6.10.0580.04278.93
5.6.00.0500.04379.04
5.5.380.0560.04279.08
5.5.370.0430.04978.75
5.5.360.0350.05679.17
5.5.350.0560.06581.85
5.5.340.0420.06780.75
5.5.330.0270.08181.72
5.5.320.0390.08281.91
5.5.310.0480.06981.76
5.5.300.0380.05680.72
5.5.290.0290.08481.01
5.5.280.0350.05682.27
5.5.270.0420.05582.28
5.5.260.0310.08882.18
5.5.250.0460.07182.11
5.5.240.0420.07781.99
5.5.230.0350.05479.08
5.5.220.0610.03678.98
5.5.210.0410.06178.65
5.5.200.0180.07778.94
5.5.190.0420.05178.88
5.5.180.0420.05278.91
5.5.170.0460.05978.85
5.5.160.0400.05678.86
5.5.150.0480.04479.01
5.5.140.0330.06178.85
5.5.130.0470.04078.90
5.5.120.0580.04979.16
5.5.110.0180.07579.25
5.5.100.0410.05278.80
5.5.90.0420.05178.93
5.5.80.0460.05278.85
5.5.70.0400.05078.72
5.5.60.0280.06578.65
5.5.50.0360.05378.94
5.5.40.0570.04378.69
5.5.30.0590.03579.05
5.5.20.0580.04178.43
5.5.10.0450.04579.02
5.5.00.0500.04378.69

preferences:
50.19 ms | 401 KiB | 5 Q