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, ' '));

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.0140.00716.50
8.3.50.0070.00722.11
8.3.40.0110.00318.84
8.3.30.0100.00319.17
8.3.20.0040.00420.35
8.3.10.0070.00023.66
8.3.00.0040.00419.43
8.2.180.0080.00616.48
8.2.170.0090.00622.96
8.2.160.0100.00320.38
8.2.150.0000.00724.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.36
8.2.110.0030.00622.19
8.2.100.0040.00821.01
8.2.90.0040.00419.34
8.2.80.0040.00417.97
8.2.70.0070.00317.75
8.2.60.0060.00618.05
8.2.50.0040.00418.07
8.2.40.0040.00418.34
8.2.30.0040.00418.20
8.2.20.0040.00417.71
8.2.10.0030.00518.05
8.2.00.0000.00819.46
8.1.280.0100.00725.92
8.1.270.0030.00523.82
8.1.260.0000.00726.35
8.1.250.0040.00428.09
8.1.240.0060.00323.91
8.1.230.0060.00619.16
8.1.220.0050.00317.78
8.1.210.0000.00818.77
8.1.200.0060.00317.25
8.1.190.0040.00417.10
8.1.180.0030.00618.10
8.1.170.0060.00318.50
8.1.160.0000.00722.00
8.1.150.0040.00418.61
8.1.140.0000.00717.35
8.1.130.0030.00317.79
8.1.120.0040.00417.45
8.1.110.0090.00017.38
8.1.100.0070.00017.42
8.1.90.0040.00417.31
8.1.80.0000.00817.29
8.1.70.0000.00717.34
8.1.60.0030.00717.64
8.1.50.0050.00317.56
8.1.40.0030.00617.49
8.1.30.0040.00417.72
8.1.20.0050.00317.57
8.1.10.0040.00417.47
8.1.00.0000.00817.43
8.0.300.0000.00718.77
8.0.290.0000.00816.63
8.0.280.0000.00718.38
8.0.270.0000.00817.18
8.0.260.0030.00317.27
8.0.250.0030.00316.83
8.0.240.0030.00316.93
8.0.230.0030.00416.73
8.0.220.0040.00416.86
8.0.210.0050.00316.85
8.0.200.0040.00416.87
8.0.190.0000.00716.78
8.0.180.0090.00816.83
8.0.170.0050.00316.90
8.0.160.0070.00016.82
8.0.150.0050.00516.69
8.0.140.0030.00516.83
8.0.130.0030.00513.24
8.0.120.0070.00016.84
8.0.110.0040.00416.88
8.0.100.0050.00216.77
8.0.90.0000.00716.73
8.0.80.0130.00716.80
8.0.70.0040.00416.86
8.0.60.0020.00516.79
8.0.50.0040.00416.63
8.0.30.0080.01117.18
8.0.20.0110.01117.40
8.0.10.0050.00317.02
8.0.00.0140.00716.96
7.4.330.0000.00515.00
7.4.320.0030.00316.43
7.4.300.0000.00616.49
7.4.290.0040.00416.61
7.4.280.0040.00416.45
7.4.270.0030.00316.59
7.4.260.0070.00016.50
7.4.250.0000.00716.38
7.4.240.0020.00616.61
7.4.230.0030.00316.69
7.4.220.0100.01416.56
7.4.210.0130.00316.53
7.4.200.0070.00016.48
7.4.160.0100.00616.62
7.4.150.0070.01317.40
7.4.140.0170.00217.86
7.4.130.0130.00316.56
7.4.120.0070.01016.50
7.4.110.0100.00616.54
7.4.100.0100.00716.48
7.4.90.0030.01616.51
7.4.80.0120.00919.39
7.4.70.0180.00416.55
7.4.60.0030.01416.49
7.4.50.0000.00816.53
7.4.40.0030.01716.63
7.4.30.0090.00616.43
7.4.00.0080.00414.84
7.3.330.0020.00213.14
7.3.320.0020.00213.38
7.3.310.0000.00616.21
7.3.300.0000.00716.36
7.3.290.0000.01316.40
7.3.280.0050.01116.32
7.3.270.0110.00617.40
7.3.260.0130.00716.31
7.3.250.0130.00616.34
7.3.240.0070.01016.37
7.3.230.0030.01216.60
7.3.210.0180.01216.37
7.3.200.0090.01219.39
7.3.190.0140.00616.27
7.3.180.0090.00616.47
7.3.170.0140.00316.28
7.3.160.0070.01416.34
7.3.120.0070.01014.81
7.2.330.0110.00716.79
7.2.320.0130.00516.81
7.2.310.0100.00716.57
7.2.300.0000.01616.41
7.2.290.0040.01216.73
7.2.60.0100.00716.90
7.2.00.0030.00619.46
7.1.200.0040.00415.87
7.1.100.0030.01417.81
7.1.70.0080.00417.20
7.1.60.0100.01319.70
7.1.50.0070.01316.92
7.1.00.0030.07722.51
7.0.200.0100.00716.97
7.0.140.0070.07022.08
7.0.60.0000.07320.05
7.0.50.0130.07317.85
7.0.40.0000.04720.02
7.0.30.0530.07320.18
7.0.20.0300.05020.09
7.0.10.0330.08320.24
7.0.00.0030.06720.33
5.6.280.0030.07321.03
5.6.210.0030.06020.53
5.6.200.0030.08318.20
5.6.190.0230.07020.68
5.6.180.0330.07020.30
5.6.170.0400.07020.52
5.6.160.0070.08020.49
5.6.150.0000.06018.28
5.6.140.0030.05018.17
5.6.130.0030.09018.18
5.6.120.0100.07721.14
5.6.110.0030.07720.96
5.6.100.0000.04320.97
5.6.90.0170.04020.88
5.6.80.0000.04320.39
5.6.70.4370.04020.50
5.5.350.0170.07020.40
5.5.340.0070.03717.99
5.5.330.0130.07720.29
5.5.320.0170.08020.48
5.5.310.0370.06720.25
5.5.300.0070.08017.95
5.5.290.0070.04017.98
5.5.280.0100.05320.84
5.5.270.0100.07720.87
5.5.260.0030.09020.84
5.5.250.0170.06020.61
5.5.240.0030.03720.29
5.4.450.2030.04719.27
5.4.440.1700.05719.31
5.4.430.2030.05019.41
5.4.420.2500.04019.16
5.4.410.1970.04319.39
5.4.400.2030.04718.99
5.4.390.2130.04018.95
5.4.380.1900.03319.20
5.4.370.2070.05019.22
5.4.360.2070.04718.95
5.4.350.1930.03718.87
5.4.340.1970.04319.14
5.4.320.2030.04319.22
5.4.310.2170.03719.00
5.4.300.1970.04019.21
5.4.290.2170.03718.94
5.4.280.1930.03019.14
5.4.270.2200.03319.10
5.4.260.2170.04719.08
5.4.250.1900.03319.24
5.4.240.2170.04018.86
5.4.230.2030.04719.09
5.4.220.2030.03719.30
5.4.210.1800.04719.08
5.4.200.2100.03719.16
5.4.190.2170.04019.32
5.4.180.2200.04718.82
5.4.170.2100.04019.14
5.4.160.2130.04019.07
5.4.150.2100.04719.14
5.4.140.2100.04316.44
5.4.130.1930.03316.51
5.4.120.2100.03716.41
5.4.110.1930.04716.52
5.4.100.2030.04016.35
5.4.90.1900.03316.51
5.4.80.2000.04016.62
5.4.70.2170.03716.44
5.4.60.2000.04316.52
5.4.50.1900.04016.25
5.4.40.2030.03716.43
5.4.30.1830.03016.53
5.4.20.1700.04016.44
5.4.10.2030.03316.47
5.4.00.2070.03015.84
5.3.290.1830.03714.68
5.3.280.2230.05314.49
5.3.270.1830.03314.57
5.3.260.1870.03714.62
5.3.250.2330.04314.57
5.3.240.1970.03314.66
5.3.230.1970.03314.60
5.3.220.1770.03314.55
5.3.210.2000.02714.46
5.3.200.1730.04014.65
5.3.190.1770.03714.46
5.3.180.1570.04014.78
5.3.170.2030.03714.79
5.3.160.2000.04014.48
5.3.150.2270.04314.61
5.3.140.2070.04314.46
5.3.130.1830.03714.54
5.3.120.1800.03714.56
5.3.110.1830.03714.63
5.3.100.1730.03313.94
5.3.90.1670.03314.24
5.3.80.1930.02714.10
5.3.70.2100.03314.13
5.3.60.2030.04013.91
5.3.50.2230.03013.85
5.3.40.2130.04013.96
5.3.30.1930.04314.02
5.3.20.2030.03013.61
5.3.10.2070.04013.61
5.3.00.1830.05013.61
5.2.170.1670.03011.15
5.2.160.1570.02711.07
5.2.150.1500.03311.11
5.2.140.1700.03711.10
5.2.130.1770.03311.08
5.2.120.1870.03011.06
5.2.110.1770.03311.11
5.2.100.1530.03011.34
5.2.90.1770.03311.22
5.2.80.1870.03011.17
5.2.70.1730.03011.14
5.2.60.1670.02710.96
5.2.50.1770.03310.99
5.2.40.1230.02710.89
5.2.30.1530.03311.02
5.2.20.1430.03311.01
5.2.10.1330.02710.98
5.2.00.1230.02710.77
5.1.60.1170.0339.99
5.1.50.1200.02710.22
5.1.40.1300.0239.87
5.1.30.1370.02310.24
5.1.20.1200.02710.31
5.1.10.1530.02010.29
5.1.00.1470.03310.15
5.0.50.0800.0338.55
5.0.40.0870.0278.34
5.0.30.0730.0308.12
5.0.20.0670.0238.13
5.0.10.0700.0278.16
5.0.00.0630.0278.08
4.4.90.0630.0108.08
4.4.80.0770.0178.08
4.4.70.0600.0178.08
4.4.60.0630.0208.08
4.4.50.0670.0178.08
4.4.40.0800.0378.08
4.4.30.0670.0138.08
4.4.20.0630.0208.08
4.4.10.0800.0278.08
4.4.00.0670.0208.08
4.3.110.0800.0108.08
4.3.100.0670.0108.08
4.3.90.0600.0138.08
4.3.80.0670.0278.08
4.3.70.0670.0178.08
4.3.60.0600.0178.08
4.3.50.0830.0078.08
4.3.40.0670.0308.08
4.3.30.0430.0108.08
4.3.20.0270.0208.08
4.3.10.0400.0208.08
4.3.00.0300.0138.08

preferences:
41.46 ms | 401 KiB | 5 Q