3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* How many times the code under test should run in each function */ define('LOOP', 10); define('MAX', 10); function f1() { for ($i = 0; $i < LOOP; ++$i) { // one liner array_map with anonymous function - 5.3+ return $array = array_map(function($d) { return 'count_' . $d; }, range(0, MAX)); } } function f2() { for ($i = 0; $i < LOOP; ++$i) { // another (convoluted) one line approach, avoiding array_map - 5.2+ return $array = explode('#', 'count_' . implode('#count_', range(0, MAX))); } } echo f1();

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.0090.00618.39
8.3.50.0090.00821.91
8.3.40.0120.00318.73
8.3.30.0090.00619.12
8.3.20.0100.00320.24
8.3.10.0040.00422.12
8.3.00.0070.00022.39
8.2.180.0190.00316.75
8.2.170.0110.00322.96
8.2.160.0070.00720.95
8.2.150.0030.00524.18
8.2.140.0290.01124.66
8.2.130.0030.01026.16
8.2.120.0050.00319.25
8.2.110.0060.00320.53
8.2.100.0120.00017.97
8.2.90.0050.00517.88
8.2.80.0050.00317.97
8.2.70.0030.00517.91
8.2.60.0040.00418.16
8.2.50.0080.00018.10
8.2.40.0000.00819.29
8.2.30.0000.00817.99
8.2.20.0050.00317.68
8.2.10.0030.00517.70
8.2.00.0050.00217.67
8.1.280.0100.01025.92
8.1.270.0090.00022.12
8.1.260.0040.00426.35
8.1.250.0050.00228.09
8.1.240.0030.00623.86
8.1.230.0070.00419.10
8.1.220.0040.00417.74
8.1.210.0000.00818.77
8.1.200.0030.00617.48
8.1.190.0080.00017.23
8.1.180.0000.00818.10
8.1.170.0000.00818.66
8.1.160.0080.00022.07
8.1.150.0000.00718.60
8.1.140.0040.00417.34
8.1.130.0070.00017.91
8.1.120.0000.00817.39
8.1.110.0000.00717.47
8.1.100.0000.00717.49
8.1.90.0000.00717.46
8.1.80.0040.00417.52
8.1.70.0030.00317.48
8.1.60.0060.00317.61
8.1.50.0000.00817.55
8.1.40.0040.00417.52
8.1.30.0060.00317.58
8.1.20.0000.00917.63
8.1.10.0000.00817.50
8.1.00.0060.00317.36
8.0.300.0040.00419.64
8.0.290.0060.00316.75
8.0.280.0020.00518.42
8.0.270.0000.00717.22
8.0.260.0000.00716.88
8.0.250.0030.00316.87
8.0.240.0000.00717.02
8.0.230.0000.00716.95
8.0.220.0000.00716.93
8.0.210.0070.00017.01
8.0.200.0000.00616.98
8.0.190.0040.00417.04
8.0.180.0040.00417.00
8.0.170.0000.00717.01
8.0.160.0040.00416.97
8.0.150.0040.00816.92
8.0.140.0070.00016.89
8.0.130.0050.00013.38
8.0.120.0080.00016.96
8.0.110.0040.00417.02
8.0.100.0040.00416.86
8.0.90.0000.00816.85
8.0.80.0030.01316.95
8.0.70.0040.00417.04
8.0.60.0000.00616.95
8.0.50.0050.00316.93
8.0.30.0080.01117.30
8.0.20.0060.01217.40
8.0.10.0000.00716.91
8.0.00.0080.00916.94
7.4.330.0050.00015.01
7.4.320.0030.00316.61
7.4.300.0030.00316.51
7.4.290.0070.00016.61
7.4.280.0070.00016.63
7.4.270.0000.00716.44
7.4.260.0070.00316.59
7.4.250.0030.00416.62
7.4.240.0050.00216.53
7.4.230.0070.00016.72
7.4.220.0040.01316.66
7.4.210.0050.01116.66
7.4.200.0030.00316.68
7.4.190.0000.00716.48
7.4.160.0080.00816.58
7.4.150.0070.01017.40
7.4.140.0120.00617.86
7.4.130.0150.00816.61
7.4.120.0120.00716.57
7.4.110.0110.00716.73
7.4.100.0070.01016.42
7.4.90.0060.01216.63
7.4.80.0100.00719.39
7.4.70.0060.01416.58
7.4.60.0000.01816.55
7.4.50.0020.00216.39
7.4.40.0030.01222.77
7.4.30.0090.01316.72
7.4.00.0090.00614.89
7.3.330.0020.00313.33
7.3.320.0000.00513.36
7.3.310.0030.00316.39
7.3.300.0000.00616.38
7.3.290.0030.01816.30
7.3.280.0090.01016.37
7.3.270.0160.00617.40
7.3.260.0090.00916.42
7.3.250.0120.00516.58
7.3.240.0070.01016.45
7.3.230.0030.01316.47
7.3.210.0060.01216.46
7.3.200.0120.00619.39
7.3.190.0070.01316.46
7.3.180.0080.00816.41
7.3.170.0100.00716.55
7.3.160.0030.01316.38
7.3.120.0110.00315.00
7.3.10.0030.01316.81
7.3.00.0030.01116.44
7.2.330.0140.00416.68
7.2.320.0100.01016.53
7.2.310.0060.01016.63
7.2.300.0080.01616.58
7.2.290.0190.00416.55
7.2.130.0030.00916.71
7.2.120.0090.00617.00
7.2.110.0030.00816.96
7.2.100.0030.00617.04
7.2.90.0030.01216.89
7.2.80.0130.00316.80
7.2.70.0030.00716.96
7.2.60.0090.00616.97
7.2.50.0000.01417.08
7.2.40.0030.01316.64
7.2.30.0140.00316.89
7.2.20.0090.00616.75
7.2.10.0100.00317.00
7.2.00.0030.01118.24
7.1.250.0100.00315.80
7.1.100.0080.00317.82
7.1.70.0040.00417.21
7.1.60.0030.01017.27
7.1.50.0070.00717.02
7.1.00.0030.07722.48
7.0.200.0060.00316.84
7.0.140.0070.06721.96
7.0.60.0030.08019.79
7.0.50.0070.04017.84
7.0.40.0130.08320.40
7.0.30.0300.05320.13
7.0.20.0300.06320.09
7.0.10.0200.05020.16
7.0.00.0070.04320.04
5.6.280.0100.06720.92
5.6.210.0070.07720.52
5.6.200.0000.08718.29
5.6.190.0070.04720.34
5.6.180.3570.04320.62
5.6.170.0200.06020.47
5.6.160.0170.06720.43
5.6.150.0100.06318.27
5.6.140.0070.04018.14
5.6.130.0130.07318.19
5.6.120.0070.08021.00
5.6.110.0300.05721.10
5.6.100.0100.08320.98
5.6.90.0070.09020.98
5.6.80.0030.08020.55
5.6.70.4500.03020.38
5.5.350.0030.03020.38
5.5.340.0100.07318.04
5.5.330.0070.03720.38
5.5.320.0170.07720.27
5.5.310.0170.04720.35
5.5.300.0100.07717.97
5.5.290.0030.08018.05
5.5.280.0070.05720.91
5.5.270.0130.06020.80
5.5.260.0130.07320.88
5.5.250.0130.07320.69
5.5.240.0100.05020.15
5.4.450.0170.05719.71
5.4.440.0230.04719.57
5.4.430.0170.05019.21
5.4.420.0070.05719.51
5.4.410.0070.06019.21
5.4.400.0800.00018.77
5.4.390.0800.00018.84
5.4.380.0270.05318.75
5.4.370.0230.05718.74
5.4.360.0430.05318.77
5.4.350.0270.06318.73
5.4.340.0270.05718.51
5.4.320.0030.03912.51
5.4.310.0070.03812.51
5.4.300.0050.04312.51
5.4.290.0090.03912.50
5.4.280.0070.04212.40
5.4.270.0070.05718.89
5.4.260.0100.05718.70
5.4.250.0100.05018.61
5.4.240.0130.07018.79
5.4.230.0130.08318.89
5.4.220.0130.05318.98
5.4.210.0230.04318.79
5.4.200.0330.05018.92
5.4.190.0100.06718.96
5.4.180.0170.05018.88
5.4.170.0170.04718.86
5.4.160.0170.05318.70
5.4.150.0070.08318.77
5.4.140.0170.06016.48
5.4.130.0300.03716.47
5.4.120.0030.05316.43
5.4.110.0070.06716.37
5.4.100.0200.08016.66
5.4.90.0200.06016.63
5.4.80.0130.05016.43
5.4.70.0200.06316.40
5.4.60.0070.05316.40
5.4.50.0100.05016.43
5.4.40.0100.06316.31
5.4.30.0070.06316.30
5.4.20.0230.09016.63
5.4.10.0170.06716.44
5.4.00.0130.06315.83
5.3.290.0120.04812.80
5.3.280.0230.04014.68
5.3.270.0130.05314.60
5.3.260.0200.06014.78
5.3.250.0070.06014.70
5.3.240.0070.06714.68
5.3.230.0130.07714.70
5.3.220.0170.06014.41
5.3.210.0200.07014.76
5.3.200.0230.05314.65
5.3.190.0070.06714.63
5.3.180.0130.07014.57
5.3.170.0130.05314.67
5.3.160.0170.07014.66
5.3.150.0230.05014.56
5.3.140.0070.07314.79
5.3.130.0130.07014.54
5.3.120.0130.06314.39
5.3.110.0130.07014.78
5.3.100.0070.06714.16
5.3.90.0030.07313.85
5.3.80.0000.07714.10
5.3.70.0130.05013.93
5.3.60.0070.07013.99
5.3.50.0070.07714.03
5.3.40.0100.07014.15
5.3.30.0170.05014.01
5.3.20.0100.04713.78
5.3.10.0200.04713.84
5.3.00.0130.06313.73
5.2.170.0130.04311.09
5.2.160.0130.03711.11
5.2.150.0070.05711.12
5.2.140.0030.04711.12
5.2.130.0170.05011.18
5.2.120.0100.04011.08
5.2.110.0070.05311.06
5.2.100.0000.05011.18
5.2.90.0100.03711.08
5.2.80.0070.04711.07
5.2.70.0100.03711.30
5.2.60.0030.05011.00
5.2.50.0070.05011.04
5.2.40.0070.04711.00
5.2.30.0200.04011.04
5.2.20.0100.05011.04
5.2.10.0130.04010.81
5.2.00.0130.04710.90
5.1.60.0030.0509.83
5.1.50.0130.04310.08
5.1.40.0170.0309.94
5.1.30.0070.03310.30
5.1.20.0000.04310.41
5.1.10.0130.04710.15
5.1.00.0100.03310.02
5.0.50.0030.0378.46
5.0.40.0130.0208.56
5.0.30.0070.0478.32
5.0.20.0130.0338.34
5.0.10.0030.0308.01
5.0.00.0030.0438.08
4.4.90.0000.0237.48
4.4.80.0000.0237.48
4.4.70.0000.0307.48
4.4.60.0000.0337.48
4.4.50.0070.0277.48
4.4.40.0030.0377.48
4.4.30.0000.0307.48
4.4.20.0070.0207.48
4.4.10.0070.0277.48
4.4.00.0030.0377.48
4.3.110.0070.0237.48
4.3.100.0030.0207.48
4.3.90.0030.0207.48
4.3.80.0070.0377.48
4.3.70.0070.0207.48
4.3.60.0000.0237.48
4.3.50.0070.0207.48
4.3.40.0030.0307.48
4.3.30.0000.0237.48
4.3.20.0000.0237.48
4.3.10.0030.0307.48
4.3.00.0000.0337.74

preferences:
46.75 ms | 401 KiB | 5 Q