3v4l.org

run code in 300+ PHP versions simultaneously
<?php // calculate sum of ordinal values of chars // starting from $start until the end of $str function charsum($str, $start) { $sum = 0; for ($i = $start, $max = strlen($str); $i < $max; ++$i) { $sum += ord($str[$i]); } return $sum; } $str = 'hello world'; echo charsum($str, strpos($str, 'x'));

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.0160.00616.75
8.3.50.0150.01121.93
8.3.40.0140.00018.84
8.3.30.0040.01119.09
8.3.20.0040.00420.27
8.3.10.0040.00423.65
8.3.00.0050.00319.68
8.2.180.0140.00716.75
8.2.170.0070.01122.96
8.2.160.0100.00320.37
8.2.150.0030.00524.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00019.36
8.2.110.0040.00422.26
8.2.100.0090.00317.84
8.2.90.0080.00019.40
8.2.80.0000.00817.97
8.2.70.0050.00717.75
8.2.60.0080.00018.04
8.2.50.0060.00318.07
8.2.40.0040.00418.22
8.2.30.0000.00818.36
8.2.20.0040.00417.84
8.2.10.0050.00318.19
8.2.00.0000.00819.68
8.1.280.0000.01425.92
8.1.270.0040.00423.91
8.1.260.0040.00426.35
8.1.250.0060.00328.09
8.1.240.0030.00622.01
8.1.230.0040.00819.09
8.1.220.0000.00817.80
8.1.210.0080.00018.77
8.1.200.0040.00717.23
8.1.190.0000.00817.36
8.1.180.0040.00418.10
8.1.170.0040.00418.48
8.1.160.0030.00522.13
8.1.150.0040.00418.61
8.1.140.0040.00417.43
8.1.130.0030.00317.91
8.1.120.0050.00317.58
8.1.110.0000.01217.52
8.1.100.0000.00717.50
8.1.90.0030.00317.57
8.1.80.0040.00417.55
8.1.70.0030.00517.54
8.1.60.0080.00017.62
8.1.50.0040.00417.58
8.1.40.0040.00417.61
8.1.30.0000.00817.68
8.1.20.0050.00317.59
8.1.10.0040.00417.51
8.1.00.0050.00317.48
8.0.300.0030.00518.77
8.0.290.0040.00416.63
8.0.280.0040.00418.33
8.0.270.0000.00817.25
8.0.260.0040.00417.11
8.0.250.0040.00416.87
8.0.240.0030.00316.92
8.0.230.0000.00716.96
8.0.220.0000.00716.82
8.0.210.0000.00716.88
8.0.200.0070.00016.86
8.0.190.0080.00016.88
8.0.180.0030.00916.79
8.0.170.0040.00416.89
8.0.160.0030.00416.95
8.0.150.0040.00416.87
8.0.140.0030.00416.90
8.0.130.0060.00313.40
8.0.120.0080.00016.82
8.0.110.0040.00416.73
8.0.100.0040.00416.88
8.0.90.0030.00616.92
8.0.80.0060.01016.85
8.0.70.0000.00716.70
8.0.60.0040.00416.78
8.0.50.0000.00716.70
8.0.30.0210.01016.99
8.0.20.0160.00817.40
8.0.10.0000.00716.92
8.0.00.0150.00816.59
7.4.330.0030.00315.00
7.4.320.0000.00616.51
7.4.300.0030.00316.28
7.4.290.0000.00716.50
7.4.280.0050.00216.46
7.4.270.0030.00316.25
7.4.260.0040.00416.34
7.4.250.0050.00216.30
7.4.240.0050.00216.41
7.4.230.0000.00816.55
7.4.220.0070.01416.43
7.4.210.0060.00916.47
7.4.200.0030.00416.30
7.4.160.0170.00716.40
7.4.150.0130.00617.40
7.4.140.0160.00817.86
7.4.130.0120.01016.46
7.4.120.0050.01916.43
7.4.110.0000.01916.43
7.4.100.0150.00916.39
7.4.90.0160.01016.59
7.4.80.0180.01119.39
7.4.70.0120.01216.36
7.4.60.0120.00616.59
7.4.50.0060.00316.47
7.4.40.0060.01216.59
7.4.30.0140.00916.45
7.4.00.0100.00715.01
7.3.330.0071.99613.38
7.3.320.0002.00113.29
7.3.310.0040.00416.20
7.3.300.0030.00316.27
7.3.290.0080.00716.43
7.3.280.0060.01616.35
7.3.270.0150.01517.40
7.3.260.0190.01016.21
7.3.250.0110.01116.44
7.3.240.0230.00916.47
7.3.230.0130.01016.39
7.3.210.0170.00916.24
7.3.200.0110.01119.39
7.3.190.0090.01816.26
7.3.180.0130.00316.40
7.3.170.0140.01116.32
7.3.160.0100.01316.29
7.3.120.0090.00614.79
7.2.330.0110.01116.57
7.2.320.0130.00616.68
7.2.310.0090.00916.65
7.2.300.0160.00416.32
7.2.290.0130.00816.54
7.2.80.0040.01216.48
7.2.60.0030.01116.75
7.2.00.0060.00919.64
7.1.200.0030.00615.93
7.1.100.0030.01017.83
7.1.70.0050.00217.20
7.1.60.0140.01119.70
7.1.50.0230.00016.95
7.1.00.0030.07722.27
7.0.200.0070.01016.64
7.0.140.0070.07021.95
7.0.60.0070.06319.87
7.0.50.0070.08017.82
7.0.40.0030.04719.87
7.0.30.0300.07319.96
7.0.20.0230.06719.80
7.0.10.0200.07719.79
7.0.00.0130.04319.64
5.6.280.0030.07321.10
5.6.210.0230.06320.71
5.6.200.0030.05318.12
5.6.190.0100.08020.36
5.6.180.0070.08320.35
5.6.170.0230.05720.43
5.6.160.0100.05720.40
5.6.150.0070.07018.11
5.6.140.0130.07318.16
5.6.130.0170.07717.99
5.6.120.0170.08021.05
5.6.110.0100.08021.12
5.6.100.0070.08320.96
5.6.90.0100.08021.13
5.6.80.0070.08320.54
5.6.70.4300.04020.28
5.5.350.0070.06720.37
5.5.340.0100.08017.95
5.5.330.0000.06320.16
5.5.320.0370.06720.20
5.5.310.0330.06320.25
5.5.300.0130.07717.94
5.5.290.0100.08017.95
5.5.280.0100.03720.85
5.5.270.0100.08020.88
5.5.260.0070.07720.77
5.5.250.0030.04020.58
5.5.240.0070.04320.16
5.4.450.0300.04343.77
5.4.440.0430.04343.77
5.4.430.0170.04737.49
5.4.420.0370.04337.17
5.4.410.0600.04033.67
5.4.400.0430.03733.63
5.4.390.0300.04333.62
5.4.380.0300.04718.67
5.4.370.0200.05018.46
5.4.360.0200.05018.67
5.4.350.0230.05318.70
5.4.340.0100.06318.50
5.4.320.0180.07612.50
5.4.310.0080.03612.50
5.4.300.0070.04912.51
5.4.290.0130.04912.50
5.4.280.0080.04712.40
5.4.270.0060.04112.40
5.4.260.0080.04012.39
5.4.250.0100.03712.40
5.4.240.0100.05212.40
5.4.230.0110.05112.39
5.4.220.0090.04712.39
5.4.210.0040.03912.39
5.4.200.0100.04112.39
5.4.190.0120.03412.38
5.4.180.0090.03612.39
5.4.170.0060.03912.39
5.4.160.0070.03812.39
5.4.150.0090.05012.39
5.4.140.0040.04112.07
5.4.130.0090.03512.06
5.4.120.0080.03612.02
5.4.110.0060.03812.02
5.4.100.0080.04112.01
5.4.90.0040.04412.02
5.4.80.0060.04512.02
5.4.70.0050.03912.01
5.4.60.0070.03812.01
5.4.50.0090.05112.01
5.4.40.0020.04512.00
5.4.30.0050.04111.99
5.4.20.0050.03911.99
5.4.10.0060.03711.99
5.4.00.0100.03411.48
5.3.290.0121.98912.80
5.3.280.0101.99712.71
5.3.270.0121.99012.72
5.3.260.0131.99812.71
5.3.250.0091.99512.72
5.3.240.0151.98712.72
5.3.230.0141.98812.71
5.3.220.0121.99412.68
5.3.210.0151.98612.68
5.3.200.0151.98812.68
5.3.190.0122.00112.68
5.3.180.0111.99512.67
5.3.170.0111.99212.67
5.3.160.0121.99212.67
5.3.150.0121.98912.67
5.3.140.0081.99412.66
5.3.130.0071.99512.66
5.3.120.0161.98512.66
5.3.110.0101.99212.66
5.3.100.0152.00812.12
5.3.90.0111.99212.08
5.3.80.0102.03612.07
5.3.70.0131.99112.07
5.3.60.0061.99612.06
5.3.50.0071.99412.00
5.3.40.0061.99512.00
5.3.30.0041.99211.94
5.3.20.0431.96511.73
5.3.10.0481.96811.69
5.3.00.0551.95511.68
5.2.170.0061.9959.16
5.2.160.0041.9989.16
5.2.150.0081.9959.16
5.2.140.0112.0009.16
5.2.130.0111.9949.12
5.2.120.0071.9959.11
5.2.110.0091.9929.12
5.2.100.0071.9999.12
5.2.90.0081.9959.12
5.2.80.0121.9939.11
5.2.70.0061.9959.11
5.2.60.0061.9969.06
5.2.50.0041.9999.04
5.2.40.0121.9909.01
5.2.30.0131.9908.98
5.2.20.0051.9968.98
5.2.10.0121.9928.89
5.2.00.0061.9958.75
5.1.60.0101.9928.04
5.1.50.0091.9938.03
5.1.40.0071.9968.01
5.1.30.0052.0038.35
5.1.20.0051.9968.37
5.1.10.0131.9898.11
5.1.00.0091.9938.11
5.0.50.0081.9966.59
5.0.40.0041.9966.45
5.0.30.0042.0006.25
5.0.20.0101.9936.22
5.0.10.0071.9966.20
5.0.00.0081.9956.20
4.4.90.0101.9924.78
4.4.80.0071.9974.75
4.4.70.0071.9944.75
4.4.60.0151.9894.76
4.4.50.0052.0004.77
4.4.40.0081.9914.71
4.4.30.0091.9944.76
4.4.20.0091.9954.84
4.4.10.0071.9924.85
4.4.00.0081.9914.76
4.3.110.0061.9974.67
4.3.100.0091.9924.66
4.3.90.0101.9974.63
4.3.80.0071.9964.59
4.3.70.0031.9974.63
4.3.60.0091.9974.63
4.3.50.0072.0004.63
4.3.40.0081.9944.53
4.3.30.0032.0003.28
4.3.20.0041.9983.25
4.3.10.0121.9873.21
4.3.00.0031.35733.62

preferences:
40.16 ms | 401 KiB | 5 Q