3v4l.org

run code in 300+ PHP versions simultaneously
<?php $numbers = array(1,2,3,4); $total = count($numbers); $sum = 0; $output = ""; $i = 0; foreach($numbers as $number) { $i = $i + 1; if ($i < $total) { echo $number; $output = $number . $output; } } echo $output; ?>

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.0040.01116.50
8.3.50.0090.01122.90
8.3.40.0070.00718.75
8.3.30.0100.00319.00
8.3.20.0050.00220.18
8.3.10.0000.00823.66
8.3.00.0040.00419.13
8.2.180.0080.00816.38
8.2.170.0120.00318.88
8.2.160.0140.00022.96
8.2.150.0080.00024.18
8.2.140.0000.00724.66
8.2.130.0040.01126.16
8.2.120.0000.00721.00
8.2.110.0080.00419.21
8.2.100.0080.00317.82
8.2.90.0030.00617.97
8.2.80.0000.00817.97
8.2.70.0050.00317.25
8.2.60.0030.00617.80
8.2.50.0060.00318.07
8.2.40.0070.00318.22
8.2.30.0050.00218.00
8.2.20.0080.00017.67
8.2.10.0020.00518.04
8.2.00.0040.00417.67
8.1.280.0040.01125.92
8.1.270.0030.00523.98
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0030.00622.45
8.1.230.0000.01120.95
8.1.220.0080.00017.76
8.1.210.0000.00918.77
8.1.200.0100.00017.22
8.1.190.0080.00017.13
8.1.180.0030.00618.10
8.1.170.0090.00018.65
8.1.160.0080.00021.87
8.1.150.0050.00318.93
8.1.140.0030.00517.46
8.1.130.0040.00417.74
8.1.120.0040.00417.36
8.1.110.0080.00017.36
8.1.100.0000.01017.41
8.1.90.0030.00417.47
8.1.80.0030.00717.44
8.1.70.0030.00317.44
8.1.60.0000.00717.53
8.1.50.0070.00017.38
8.1.40.0070.00317.45
8.1.30.0040.00417.67
8.1.20.0040.00417.47
8.1.10.0050.00217.48
8.1.00.0000.00817.49
8.0.300.0040.00419.89
8.0.290.0040.00416.63
8.0.280.0000.00718.36
8.0.270.0030.00317.19
8.0.260.0000.00717.13
8.0.250.0040.00416.85
8.0.240.0040.00416.84
8.0.230.0040.00416.79
8.0.220.0030.00316.90
8.0.210.0030.00316.78
8.0.200.0000.00616.84
8.0.190.0040.00416.84
8.0.180.0000.00716.76
8.0.170.0040.00416.84
8.0.160.0080.00016.98
8.0.150.0030.00316.74
8.0.140.0000.00716.71
8.0.130.0000.00513.36
8.0.120.0040.00416.84
8.0.110.0040.00416.90
8.0.100.0020.00516.95
8.0.90.0000.00716.68
8.0.80.0060.01516.88
8.0.70.0000.00716.89
8.0.60.0050.00416.86
8.0.50.0000.00716.93
8.0.30.0120.01617.15
8.0.20.0100.00917.42
8.0.10.0080.00016.99
8.0.00.0110.00716.84
7.4.330.0000.00615.00
7.4.320.0030.00316.55
7.4.300.0020.00516.50
7.4.290.0000.00816.38
7.4.280.0000.00816.64
7.4.270.0040.00416.46
7.4.260.0040.00416.54
7.4.250.0040.00416.45
7.4.240.0000.00716.63
7.4.230.0040.00416.43
7.4.220.0070.01516.45
7.4.210.0070.00716.63
7.4.200.0030.00516.59
7.4.160.0120.00316.43
7.4.150.0180.00317.40
7.4.140.0100.00817.86
7.4.130.0070.00916.48
7.4.120.0100.00716.64
7.4.110.0150.00616.61
7.4.100.0080.01216.43
7.4.90.0120.00616.55
7.4.80.0170.00319.39
7.4.70.0140.00516.46
7.4.60.0060.01116.47
7.4.50.0030.00516.54
7.4.40.0100.00716.57
7.4.30.0140.00316.33
7.4.00.0040.01114.72
7.3.330.0000.00613.15
7.3.320.0000.00513.13
7.3.310.0050.00216.26
7.3.300.0060.00016.26
7.3.290.0070.00716.21
7.3.280.0090.00616.28
7.3.270.0120.00617.40
7.3.260.0150.00516.29
7.3.250.0100.00716.40
7.3.240.0070.01016.52
7.3.230.0140.00316.39
7.3.210.0120.01216.48
7.3.200.0070.01019.39
7.3.190.0100.00616.32
7.3.180.0100.01016.22
7.3.170.0060.01016.52
7.3.160.0100.00616.52
7.2.330.0090.00916.34
7.2.320.0040.01216.70
7.2.310.0180.00016.36
7.2.300.0060.01216.41
7.2.290.0060.01016.32
7.2.110.0000.01616.70
7.2.100.0130.01316.56
7.2.90.0150.00616.73
7.2.80.0070.01416.51
7.2.70.0060.01416.72
7.2.60.0060.01116.78
7.2.50.0150.00916.61
7.2.40.0080.01216.60
7.2.30.0110.01116.75
7.2.20.0150.00316.45
7.2.10.0100.01216.40
7.2.00.0040.01318.23
7.1.230.0140.01115.94
7.1.220.0130.01015.52
7.1.210.0110.00515.89
7.1.200.0100.00815.63
7.1.190.0080.01215.24
7.1.180.0040.01315.58
7.1.170.0150.00315.48
7.1.160.0040.01215.36
7.1.150.0100.01015.63
7.1.140.0180.00715.66
7.1.130.0170.00415.44
7.1.120.0180.00315.24
7.1.110.0150.01215.63
7.1.100.0070.00916.92
7.1.90.0080.01315.84
7.1.80.0170.01315.88
7.1.70.0100.00416.40
7.1.60.0140.00817.75
7.1.50.0100.01316.42
7.1.40.0090.00615.88
7.1.30.0220.01015.94
7.1.20.0220.01115.95
7.1.10.0130.00815.34
7.1.00.0030.04318.98
7.0.310.0170.00815.19
7.0.300.0130.01015.25
7.0.290.0170.00615.27
7.0.280.0160.00814.82
7.0.270.0170.00815.30
7.0.260.0170.01115.14
7.0.250.0120.00715.05
7.0.240.0160.00315.26
7.0.230.0190.01215.36
7.0.220.0120.01215.47
7.0.210.0160.01215.56
7.0.200.0090.00516.17
7.0.190.0260.00615.12
7.0.180.0150.00615.36
7.0.170.0240.00415.58
7.0.160.0160.01015.18
7.0.150.0280.00315.43
7.0.140.0050.04018.77
7.0.130.0110.00015.30
7.0.120.0090.00315.35
7.0.110.0100.00315.16
7.0.100.0060.00915.07
7.0.90.0060.01115.41
7.0.80.0060.00615.20
7.0.70.0100.00315.19
7.0.60.0040.05117.73
7.0.50.0020.04516.76
7.0.40.0060.02416.86
7.0.30.0210.04116.86
7.0.20.0140.02316.79
7.0.10.0120.04116.71
7.0.00.0050.05016.75
5.6.380.0110.00814.45
5.6.370.0110.00813.90
5.6.360.0000.01814.16
5.6.350.0030.01314.33
5.6.340.0110.01114.13
5.6.330.0150.00414.01
5.6.320.0100.00813.77
5.6.310.0210.00614.02
5.6.300.0000.01614.40
5.6.290.0040.00714.28
5.6.280.0090.03517.64
5.6.270.0030.00613.91
5.6.260.0130.00014.05
5.6.250.0060.00914.10
5.6.240.0090.00614.35
5.6.230.0030.01014.20
5.6.220.0000.01214.05
5.6.210.0030.02617.65
5.6.200.0080.04516.13
5.6.190.0080.02317.44
5.6.180.0210.03417.38
5.6.170.0200.03917.42
5.6.160.0080.03517.34
5.6.150.0110.03616.08
5.6.140.0100.04016.10
5.6.130.0070.04616.14
5.6.120.0140.03617.52
5.6.110.0060.04017.46
5.6.100.0090.04517.60
5.6.90.0080.04317.59
5.6.80.0090.02117.41
5.6.70.0120.00014.21
5.6.60.0060.01013.88
5.6.50.0060.00614.20
5.6.40.0030.01214.10
5.6.30.0090.00314.10
5.6.20.0090.00314.04
5.6.10.0130.00014.37
5.6.00.0080.00613.97
5.5.380.0060.00010.84
5.5.370.0040.00810.75
5.5.360.0060.00611.21
5.5.350.0040.04415.69
5.5.340.0040.04314.47
5.5.330.0030.02415.59
5.5.320.0220.04015.64
5.5.310.0190.03715.51
5.5.300.0060.02014.44
5.5.290.0090.04214.58
5.5.280.0040.02615.72
5.5.270.0060.02315.73
5.5.260.0060.04615.73
5.5.250.0070.03015.80
5.5.240.1940.02315.48
5.5.230.0030.00610.71
5.5.220.0060.00610.69
5.5.210.0090.00310.88
5.5.200.0030.01010.69
5.5.190.0000.01110.66
5.5.180.0060.00610.99
5.5.170.0090.00614.14
5.5.160.0080.00310.81
5.5.150.0060.00610.82
5.5.140.0060.00610.93
5.5.130.0070.00410.77
5.5.120.0090.00311.13
5.5.110.0080.00010.96
5.5.100.0090.00311.16
5.5.90.0030.00511.16
5.5.80.0060.00611.05
5.5.70.0050.00510.85
5.5.60.0000.01110.93
5.5.50.0050.00510.84
5.5.40.0050.00510.98
5.5.30.0090.00311.05
5.5.20.0070.00311.08
5.5.10.0080.00311.11
5.5.00.0070.00311.01
5.4.450.0180.02414.98
5.4.440.0180.02915.10
5.4.430.0340.02315.10
5.4.420.0140.02615.15
5.4.410.0210.02315.02
5.4.400.0180.02315.07
5.4.390.0200.02314.91
5.4.380.0080.03214.83
5.4.370.0080.03114.65
5.4.360.0150.03814.73
5.4.350.0030.03614.82
5.4.340.0180.02814.87
5.4.330.0060.00611.02
5.4.320.0040.02311.72
5.4.310.0040.02411.62
5.4.300.0040.02111.70
5.4.290.0080.01911.55
5.4.280.0060.01911.65
5.4.270.0050.02211.57
5.4.260.0020.02511.64
5.4.250.0040.02311.77
5.4.240.0060.01911.65
5.4.230.0070.02011.66
5.4.220.0040.02211.56
5.4.210.0070.01911.65
5.4.200.0070.02011.53
5.4.190.0060.02011.62
5.4.180.0060.02011.61
5.4.170.0050.02211.68
5.4.160.0090.01811.45
5.4.150.0060.01911.70
5.4.140.0060.02111.35
5.4.130.0080.01811.37
5.4.120.0040.02111.43
5.4.110.0060.02011.36
5.4.100.0030.02411.49
5.4.90.0060.02011.34
5.4.80.0060.02211.52
5.4.70.0060.01911.34
5.4.60.0080.01811.47
5.4.50.0070.01911.47
5.4.40.0060.02011.29
5.4.30.0090.01611.46
5.4.20.0070.01911.42
5.4.10.0030.02211.40
5.4.00.0060.02111.21
5.3.290.0050.02211.73
5.3.280.0060.02211.50
5.3.270.0040.02211.52
5.3.260.0060.02211.61
5.3.250.0050.02111.58
5.3.240.0040.02211.51
5.3.230.0060.02111.57
5.3.220.0070.02011.46
5.3.210.0030.02511.40
5.3.200.0050.02211.43
5.3.190.0030.02311.53
5.3.180.0060.02011.58
5.3.170.0050.02111.62
5.3.160.0070.01911.60
5.3.150.0050.02211.46
5.3.140.0060.02111.48
5.3.130.0070.02011.44
5.3.120.0050.02311.45
5.3.110.0080.02011.48
5.3.100.0050.02211.18
5.3.90.0040.02211.27
5.3.80.0060.02011.17
5.3.70.0050.02011.13
5.3.60.0050.02111.23
5.3.50.0070.01811.18
5.3.40.0050.02211.20
5.3.30.0070.01911.18
5.3.20.0030.02111.03
5.3.10.0060.01910.93
5.3.00.0030.02510.92
5.2.170.0050.0179.43
5.2.160.0050.0169.35
5.2.150.0030.0189.36
5.2.140.0050.0189.24
5.2.130.0050.0159.13
5.2.120.0040.0179.28
5.2.110.0050.0179.38
5.2.100.0080.0149.32
5.2.90.0060.0169.17
5.2.80.0060.0169.23
5.2.70.0050.0179.25
5.2.60.0050.0159.10
5.2.50.0040.0179.10
5.2.40.0060.0149.21
5.2.30.0060.0159.03
5.2.20.0060.0169.13
5.2.10.0060.0159.16
5.2.00.0020.0189.00
5.1.60.0040.0148.40
5.1.50.0060.0138.40
5.1.40.0040.0148.40
5.1.30.0020.0178.57
5.1.20.0040.0168.58
5.1.10.0040.0158.44
5.1.00.0030.0158.44
5.0.50.0040.0127.68
5.0.40.0030.0117.61
5.0.30.0030.0177.52
5.0.20.0040.0117.50
5.0.10.0040.0117.49
5.0.00.0030.0187.48
4.4.90.0030.0096.75
4.4.80.0030.0086.74
4.4.70.0020.0116.74
4.4.60.0030.0096.74
4.4.50.0020.0116.75
4.4.40.0040.0136.72
4.4.30.0020.0106.74
4.4.20.0050.0086.79
4.4.10.0040.0096.79
4.4.00.0030.0156.74
4.3.110.0040.0096.70
4.3.100.0010.0116.70
4.3.90.0010.0116.68
4.3.80.0030.0146.66
4.3.70.0030.0096.68
4.3.60.0000.0106.68
4.3.50.0030.0096.68
4.3.40.0030.0146.63
4.3.30.0010.0116.01
4.3.20.0010.0106.00
4.3.10.0020.0095.98
4.3.00.0030.01212.18

preferences:
36.92 ms | 401 KiB | 5 Q