3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Sum byte values from position x in $str **/ function sum( $str, $x ) { $sum = 0; for ( $max = strlen( $str ); $x < $max; ++$x ) { $sum += ord( $str[ $x ] ); } return $sum; } $str = 'Hello, Dolly'; echo sum($str, strpos( $str, 'D')); //

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.40.0060.00918.97
8.3.30.0080.00619.08
8.3.20.0000.00720.41
8.3.10.0000.00723.56
8.3.00.0070.00417.93
8.2.170.0070.00722.96
8.2.160.0110.00320.48
8.2.150.0080.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00019.50
8.2.110.0060.00322.14
8.2.100.0040.00718.03
8.2.90.0000.00919.36
8.2.80.0000.00817.97
8.2.70.0040.00417.63
8.2.60.0000.00817.93
8.2.50.0030.00618.07
8.2.40.0040.00418.13
8.2.30.0040.00418.19
8.2.20.0000.00817.82
8.2.10.0040.00418.03
8.2.00.0000.00817.68
8.1.270.0000.00823.92
8.1.260.0000.00726.35
8.1.250.0050.00228.09
8.1.240.0040.00422.14
8.1.230.0070.00419.07
8.1.220.0030.00617.74
8.1.210.0030.00518.77
8.1.200.0030.00617.23
8.1.190.0000.00817.10
8.1.180.0030.00618.10
8.1.170.0050.00318.66
8.1.160.0050.00221.86
8.1.150.0040.00418.58
8.1.140.0000.00717.42
8.1.130.0000.00717.88
8.1.120.0040.00417.29
8.1.110.0040.00417.28
8.1.100.0020.00517.43
8.1.90.0040.00417.25
8.1.80.0000.00717.43
8.1.70.0030.00317.20
8.1.60.0000.00917.60
8.1.50.0000.00817.49
8.1.40.0050.00217.51
8.1.30.0060.00317.67
8.1.20.0030.00517.71
8.1.10.0040.00417.60
8.1.00.0040.00417.58
8.0.300.0080.00018.77
8.0.290.0060.00316.75
8.0.280.0040.00418.47
8.0.270.0050.00317.24
8.0.260.0030.00317.25
8.0.250.0000.00716.96
8.0.240.0000.01016.82
8.0.230.0000.00716.94
8.0.220.0030.00316.84
8.0.210.0080.00016.87
8.0.200.0040.00416.91
8.0.190.0030.00516.80
8.0.180.0060.00316.86
8.0.170.0030.00316.83
8.0.160.0080.00016.77
8.0.150.0080.00016.72
8.0.140.0040.00416.82
8.0.130.0030.00313.19
8.0.120.0080.00016.73
8.0.110.0000.00716.82
8.0.100.0080.00016.87
8.0.90.0030.00316.95
8.0.80.0060.00916.86
8.0.70.0070.00016.81
8.0.60.0050.00216.73
8.0.50.0070.00016.89
8.0.30.0110.00916.98
8.0.20.0140.00517.40
8.0.10.0000.00716.94
8.0.00.0110.01116.59
7.4.330.0040.00415.00
7.4.320.0030.00316.45
7.4.300.0030.00316.64
7.4.290.0030.00516.59
7.4.280.0000.00816.38
7.4.270.0000.00716.52
7.4.260.0040.00416.63
7.4.250.0040.00416.40
7.4.240.0030.00416.56
7.4.230.0000.00716.57
7.4.220.0090.00916.45
7.4.210.0100.01016.55
7.4.200.0070.00016.48
7.4.160.0100.00616.64
7.4.150.0180.00317.40
7.4.140.0150.00617.86
7.4.130.0050.01416.55
7.4.120.0110.00916.53
7.4.110.0040.01416.55
7.4.100.0090.00916.66
7.4.90.0070.01016.39
7.4.80.0090.01016.54
7.4.70.0110.00616.38
7.4.60.0110.00616.62
7.4.50.0000.00916.43
7.4.40.0160.00616.61
7.4.30.0070.01016.61
7.4.10.0070.01015.12
7.4.00.0080.01014.95
7.3.330.0020.00213.35
7.3.320.0000.00613.31
7.3.310.0060.00016.22
7.3.300.0000.00616.33
7.3.290.0090.01016.36
7.3.280.0110.00916.31
7.3.270.0030.01417.40
7.3.260.0100.01316.44
7.3.250.0110.00616.51
7.3.240.0120.00916.61
7.3.230.0090.00916.39
7.3.210.0100.00616.30
7.3.200.0140.00819.39
7.3.190.0040.01216.33
7.3.180.0070.01116.34
7.3.170.0100.00916.45
7.3.160.0120.00616.50
7.3.130.0060.00914.97
7.3.120.0120.00514.76
7.3.110.0020.01514.80
7.3.100.0050.01014.87
7.3.90.0100.00514.77
7.3.80.0050.00914.83
7.3.70.0070.00914.87
7.3.60.0130.00014.79
7.3.50.0070.00514.91
7.3.40.0070.00814.82
7.3.30.0070.01214.67
7.3.20.0050.01016.53
7.3.10.0080.00316.43
7.3.00.0050.01016.81
7.2.330.0070.01016.72
7.2.320.0090.00616.93
7.2.310.0070.01016.55
7.2.300.0060.01016.88
7.2.290.0130.00416.43
7.2.260.0000.01815.31
7.2.250.0130.00414.75
7.2.240.0080.00815.16
7.2.230.0070.00715.15
7.2.220.0080.00715.25
7.2.210.0040.01215.04
7.2.200.0050.00815.01
7.2.190.0050.01115.03
7.2.180.0060.00915.07
7.2.170.0080.00814.93
7.2.160.0050.01015.25
7.2.150.0020.01217.03
7.2.140.0060.00616.79
7.2.130.0060.01116.94
7.2.120.0100.00516.88
7.2.110.0020.01316.93
7.2.100.0070.00717.09
7.2.90.0050.01017.07
7.2.80.0080.00616.98
7.2.70.0070.00616.96
7.2.60.0040.00917.02
7.2.50.0020.01217.01
7.2.40.0080.01016.89
7.2.30.0050.00516.92
7.2.20.0070.00817.06
7.2.10.0060.00717.12
7.2.00.0060.00517.74
7.1.330.0030.01015.71
7.1.320.0090.00615.66
7.1.310.0020.01215.69
7.1.300.0080.00515.70
7.1.290.0100.00815.81
7.1.280.0020.01315.88
7.1.270.0080.00515.84
7.1.260.0060.00615.76
7.1.250.0080.00815.80
7.1.240.0060.01215.77
7.1.230.0120.00015.70
7.1.220.0060.00615.58
7.1.210.0090.00315.95
7.1.200.0060.00615.86
7.1.190.0070.00715.98
7.1.180.0000.01015.61
7.1.170.0030.01415.91
7.1.160.0070.00715.79
7.1.150.0070.00315.95
7.1.140.0070.00315.58
7.1.130.0070.01115.61
7.1.120.0040.00415.79
7.1.110.0090.00615.75
7.1.100.0060.00917.07
7.1.90.0040.01115.71
7.1.80.0080.00415.96
7.1.70.0050.00916.48
7.1.60.0090.01217.81
7.1.50.0070.01316.17
7.1.40.0070.01015.59
7.1.30.0070.01015.80
7.1.20.0030.01015.60
7.1.10.0030.01015.61
7.1.00.0100.03519.21
7.0.330.0000.01715.43
7.0.320.0000.00915.43
7.0.310.0040.00715.44
7.0.300.0070.01015.45
7.0.290.0070.01015.20
7.0.280.0000.01515.38
7.0.270.0040.01115.14
7.0.260.0000.01615.22
7.0.250.0040.01115.50
7.0.240.0070.00715.48
7.0.230.0060.00615.53
7.0.220.0000.01515.37
7.0.210.0120.00015.40
7.0.200.0020.01015.98
7.0.190.0040.01115.40
7.0.180.0060.00615.44
7.0.170.0080.00015.52
7.0.160.0100.00715.33
7.0.150.0070.00715.58
7.0.140.0060.03818.77
7.0.130.0070.00715.35
7.0.120.0030.01015.32
7.0.110.0030.01315.52
7.0.100.0030.01115.51
7.0.90.0070.00715.25
7.0.80.0120.00315.52
7.0.70.0030.01215.51
7.0.60.0050.04217.69
7.0.50.0080.04216.79
7.0.40.0030.02616.69
7.0.30.0150.02316.83
7.0.20.0100.02816.72
7.0.10.0170.04116.78
7.0.00.0080.04216.71
5.6.400.0100.00614.84
5.6.390.0070.01014.41
5.6.380.0110.00314.27
5.6.370.0090.00314.39
5.6.360.0030.01014.39
5.6.350.0030.01014.71
5.6.340.0030.00614.29
5.6.330.0070.00414.18
5.6.320.0070.01014.75
5.6.310.0090.00614.70
5.6.300.0090.00614.37
5.6.290.0000.01414.61
5.6.280.0070.01014.34
5.6.270.0040.01114.30
5.6.260.0000.01314.39
5.6.250.0040.00814.30
5.6.240.0040.00814.68
5.6.230.0090.00614.41
5.6.220.0080.00314.46
5.6.210.0100.04017.55
5.6.200.0110.04216.33
5.6.190.0090.03517.63
5.6.180.0050.02717.29
5.6.170.0190.03017.34
5.6.160.0050.02817.42
5.6.150.0070.04516.36
5.6.140.0060.02116.30
5.6.130.0050.04416.29
5.6.120.0080.03317.75
5.6.110.0050.04717.63
5.6.100.0030.04217.70
5.6.90.0110.04117.72
5.6.80.0050.04217.44
5.6.70.1790.02217.36
5.6.60.0100.00314.19
5.6.50.0040.01414.25
5.6.40.0090.00314.28
5.6.30.0040.00714.26
5.6.20.0120.00314.55
5.6.10.0060.01214.53
5.6.00.0000.01714.46
5.5.380.0060.00914.18
5.5.370.0050.00714.46
5.5.360.0030.01014.04
5.5.350.0050.04517.21
5.5.340.0050.04516.28
5.5.330.0100.03017.32
5.5.320.0170.02817.29
5.5.310.0100.02817.21
5.5.300.0090.03316.10
5.5.290.0100.04116.10
5.5.280.0060.02517.60
5.5.270.0130.03817.79
5.5.260.0020.04417.72
5.5.250.0040.02617.56
5.5.240.0030.04317.26
5.5.230.0070.00314.05
5.5.220.0030.00614.42
5.5.210.0040.01414.31
5.5.200.0040.00714.39
5.5.190.0030.01014.46
5.5.180.0080.00813.95
5.5.170.0070.00714.46
5.5.160.0000.01614.22
5.5.150.0030.00914.48
5.5.140.0030.01014.38
5.5.130.0040.00814.23
5.5.120.0110.00414.22
5.5.110.0040.01214.12
5.5.100.0060.01014.38
5.5.90.0120.00314.27
5.5.80.0120.00014.32
5.5.70.0120.00013.97
5.5.60.0000.01114.02
5.5.50.0040.00414.19
5.5.40.0120.00314.42
5.5.30.0070.00414.16
5.5.20.0000.01414.06
5.5.10.0030.01314.42
5.5.00.0030.01314.22
5.4.450.0190.02427.75
5.4.440.0280.02027.74
5.4.430.0120.02327.74
5.4.420.0130.03027.74
5.4.410.0150.03715.55
5.4.400.0150.02724.60
5.4.390.0120.02715.47
5.4.380.0150.03215.11
5.4.370.0140.02815.12
5.4.360.0050.03215.11
5.4.350.0280.02615.18
5.4.340.0100.03215.19
5.4.330.0110.00311.71
5.4.320.0040.02212.10
5.4.310.0050.02312.10
5.4.300.0050.02212.10
5.4.290.0050.02212.10
5.4.280.0050.02112.05
5.4.270.0060.02212.05
5.4.260.0020.02512.05
5.4.250.0030.02412.05
5.4.240.0050.02112.05
5.4.230.0070.02212.05
5.4.220.0060.02012.05
5.4.210.0040.02012.05
5.4.200.0080.01812.05
5.4.190.0020.02412.04
5.4.180.0060.02212.05
5.4.170.0060.02012.05
5.4.160.0040.02112.05
5.4.150.0020.02312.05
5.4.140.0050.02011.89
5.4.130.0080.01911.88
5.4.120.0050.02311.86
5.4.110.0080.02211.86
5.4.100.0050.02211.86
5.4.90.0060.02511.86
5.4.80.0060.02811.86
5.4.70.0070.01911.86
5.4.60.0040.02111.86
5.4.50.0050.02111.86
5.4.40.0050.02011.85
5.4.30.0080.02111.85
5.4.20.0040.02111.85
5.4.10.0070.02411.85
5.4.00.0050.02211.60
5.3.290.0100.02112.25
5.3.280.0090.02312.21
5.3.270.0040.02712.21
5.3.260.0060.02112.21
5.3.250.0020.02112.21
5.3.240.0060.02112.21
5.3.230.0060.01912.21
5.3.220.0080.02012.19
5.3.210.0070.02112.19
5.3.200.0060.02012.19
5.3.190.0050.02212.19
5.3.180.0050.02212.19
5.3.170.0020.02412.19
5.3.160.0050.02312.19
5.3.150.0050.02212.19
5.3.140.0070.01912.18
5.3.130.0030.02512.18
5.3.120.0050.02112.18
5.3.110.0070.02112.18
5.3.100.0070.01911.91
5.3.90.0040.02211.90
5.3.80.0070.02111.90
5.3.70.0040.02611.90
5.3.60.0060.02211.89
5.3.50.0040.02411.87
5.3.40.0050.02211.86
5.3.30.0060.02511.84
5.3.20.0050.02511.73
5.3.10.0080.01911.72
5.3.00.0010.02411.71
5.2.170.0030.0339.21
5.2.160.0070.0299.22
5.2.150.0060.0309.21
5.2.140.0060.0409.21
5.2.130.0050.0369.17
5.2.120.0070.0279.17
5.2.110.0040.0409.18
5.2.100.0050.0309.18
5.2.90.0040.0339.18
5.2.80.0050.0429.17
5.2.70.0070.0409.17
5.2.60.0050.0309.13
5.2.50.0080.0279.09
5.2.40.0010.0339.07
5.2.30.0040.0309.04
5.2.20.0060.0289.03
5.2.10.0060.0318.94
5.2.00.0050.0308.80
5.1.60.0050.0248.09
5.1.50.0050.0258.09
5.1.40.0060.0248.06
5.1.30.0060.0298.41
5.1.20.0050.0278.44
5.1.10.0030.0288.17
5.1.00.0060.0248.17
5.0.50.0020.0246.63
5.0.40.0040.0276.50
5.0.30.0050.0336.31
5.0.20.0020.0226.27
5.0.10.0050.0196.26
5.0.00.0040.0316.25
4.4.90.0030.0164.78
4.4.80.0000.0194.75
4.4.70.0020.0164.76
4.4.60.0010.0194.75
4.4.50.0070.0184.77
4.4.40.0040.0274.71
4.4.30.0030.0154.76
4.4.20.0040.0154.84
4.4.10.0040.0154.85
4.4.00.0040.0244.76
4.3.110.0010.0184.67
4.3.100.0030.0154.67
4.3.90.0040.0134.63
4.3.80.0020.0254.58
4.3.70.0030.0154.63
4.3.60.0030.0154.63
4.3.50.0040.0164.63
4.3.40.0000.0294.54
4.3.30.0040.0243.30
4.3.20.0030.0153.27
4.3.10.0040.0213.24
4.3.00.0030.02037.17

preferences:
48.88 ms | 400 KiB | 5 Q