3v4l.org

run code in 300+ PHP versions simultaneously
<?php function calculate_hub_sortation_check_digit($str_hub_sortation_prefix) { $arr_split_prefix = str_split($str_hub_sortation_prefix); $int_weight = 19; $int_total = 0; // calculate position coefficient foreach($arr_split_prefix as $int_i => $mix_value) { $int_total += $mix_value * $int_weight; $int_weight--; } // modulus 11 $int_hub_check_digit = $int_total % 11; // if modulus is 10, check digit is repetition of last digit if ($int_hub_check_digit === 10) { echo "is ten\n"; $int_hub_check_digit = array_pop($arr_split_prefix); } return $int_hub_check_digit; } echo calculate_hub_sortation_check_digit('0465011111500021051');

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.0080.00618.15
8.3.50.0190.01021.15
8.3.40.0000.01418.83
8.3.30.0030.01020.20
8.3.20.0070.00020.16
8.3.10.0000.00721.09
8.3.00.0050.00322.29
8.2.180.0070.01518.29
8.2.170.0080.00622.96
8.2.160.0100.00322.08
8.2.150.0050.00324.18
8.2.140.0060.00324.66
8.2.130.0040.00426.16
8.2.120.0080.00020.74
8.2.110.0060.00320.53
8.2.100.0030.00817.97
8.2.90.0040.00419.23
8.2.80.0000.00917.97
8.2.70.0040.00417.38
8.2.60.0090.00017.93
8.2.50.0050.00318.07
8.2.40.0060.00318.20
8.2.30.0000.00919.45
8.2.20.0070.00017.59
8.2.10.0080.00017.73
8.2.00.0000.00817.74
8.1.280.0120.00325.92
8.1.270.0050.00323.99
8.1.260.0070.00026.35
8.1.250.0090.00028.09
8.1.240.0000.00922.18
8.1.230.0050.00517.52
8.1.220.0080.00017.75
8.1.210.0050.00318.77
8.1.200.0060.00317.23
8.1.190.0050.00317.50
8.1.180.0000.00718.10
8.1.170.0030.00618.48
8.1.160.0040.00418.81
8.1.150.0080.00018.52
8.1.140.0040.00417.49
8.1.130.0030.00317.79
8.1.120.0050.00317.54
8.1.110.0000.00817.50
8.1.100.0040.00417.47
8.1.90.0000.00817.49
8.1.80.0040.00417.48
8.1.70.0040.00417.34
8.1.60.0060.00317.60
8.1.50.0080.00017.54
8.1.40.0030.00517.55
8.1.30.0000.00817.52
8.1.20.0000.00817.64
8.1.10.0020.00517.39
8.1.00.0000.00817.38
8.0.300.0030.00618.77
8.0.290.0000.00716.75
8.0.280.0030.00318.44
8.0.270.0000.00817.26
8.0.260.0030.00316.70
8.0.250.0060.00316.98
8.0.240.0000.00716.96
8.0.230.0030.00316.96
8.0.220.0060.00016.91
8.0.210.0030.00316.79
8.0.200.0000.00616.94
8.0.190.0040.00316.95
8.0.180.0080.00016.79
8.0.170.0040.00316.87
8.0.160.0030.00316.87
8.0.150.0030.00416.87
8.0.140.0030.00716.86
8.0.130.0060.00013.33
8.0.120.0040.00416.82
8.0.110.0000.00716.90
8.0.100.0000.00816.88
8.0.90.0000.00716.94
8.0.80.0040.01116.93
8.0.70.0000.00716.73
8.0.60.0000.00716.76
8.0.50.0040.00416.79
8.0.30.0120.00717.25
8.0.20.0150.00617.40
8.0.10.0000.00717.05
8.0.00.0110.00816.73
7.4.330.0020.00216.82
7.4.320.0000.00716.61
7.4.300.0000.00616.50
7.4.290.0000.00816.63
7.4.280.0000.00616.64
7.4.270.0040.00416.55
7.4.260.0000.00513.28
7.4.250.0080.00016.45
7.4.240.0000.00716.61
7.4.230.0030.00316.63
7.4.220.0180.00716.61
7.4.210.0110.00716.50
7.4.200.0030.00316.59
7.4.190.0040.00416.66
7.4.160.0060.00916.57
7.4.150.0060.01217.40
7.4.140.0120.00717.86
7.4.130.0060.01116.52
7.4.120.0110.00816.48
7.4.110.0090.00916.54
7.4.100.0030.01416.56
7.4.90.0070.01116.66
7.4.80.0130.00319.39
7.4.70.0100.00616.43
7.4.60.0090.00916.50
7.4.50.0070.00016.23
7.4.40.0110.00422.77
7.4.30.0130.00816.49
7.4.00.0080.01014.87
7.3.330.0050.00013.36
7.3.320.0000.00513.23
7.3.310.0000.00716.32
7.3.300.0030.00316.23
7.3.290.0100.00316.36
7.3.280.0070.01016.33
7.3.270.0060.01217.40
7.3.260.0120.00818.24
7.3.250.0110.00916.34
7.3.240.0120.00916.59
7.3.230.0100.00616.45
7.3.210.0060.01516.37
7.3.200.0030.01319.39
7.3.190.0120.00916.57
7.3.180.0160.00016.71
7.3.170.0040.01216.56
7.3.160.0150.00616.42
7.3.120.0040.01114.82
7.3.110.0050.01114.67
7.3.100.0070.00514.83
7.3.90.0000.01114.79
7.3.80.0060.00814.88
7.3.70.0030.01014.73
7.3.60.0070.00914.87
7.3.50.0030.00814.68
7.3.40.0030.01014.83
7.3.30.0040.00914.69
7.3.20.0050.01116.50
7.3.10.0080.00616.57
7.3.00.0050.00916.59
7.2.330.0090.00916.72
7.2.320.0120.00616.55
7.2.310.0190.00616.77
7.2.300.0070.01016.71
7.2.290.0120.00916.48
7.2.250.0070.01315.03
7.2.240.0050.01315.20
7.2.230.0050.01014.90
7.2.220.0080.00614.97
7.2.210.0060.00915.01
7.2.200.0060.00615.08
7.2.190.0050.00715.13
7.2.180.0070.00515.09
7.2.170.0090.00415.05
7.2.130.0000.01216.85
7.2.120.0050.00716.92
7.2.110.0090.00716.96
7.2.100.0070.00916.75
7.2.90.0050.00817.12
7.2.80.0030.01216.81
7.2.70.0090.00616.88
7.2.60.0040.00816.84
7.2.50.0070.01216.90
7.2.40.0050.00716.81
7.2.30.0030.01117.02
7.2.20.0050.01116.88
7.2.10.0050.00716.80
7.2.00.0090.00617.78
7.1.330.0110.00315.69
7.1.320.0040.00615.66
7.1.310.0100.00715.83
7.1.300.0050.00815.75
7.1.290.0060.00515.60
7.1.280.0070.00915.86
7.1.270.0070.00615.67
7.1.260.0040.00715.92
7.1.250.0050.00915.58
7.1.240.0100.00315.82
7.1.230.0100.00315.94
7.1.220.0100.00315.67
7.1.210.0070.00715.82
7.1.200.0000.01215.83
7.1.190.0050.00815.46
7.1.180.0100.00315.78
7.1.170.0000.00815.77
7.1.160.0030.01015.88
7.1.150.0030.01015.62
7.1.140.0040.01115.89
7.1.130.0030.00915.86
7.1.120.0030.00915.79
7.1.110.0000.00715.52
7.1.100.0030.00616.95
7.1.90.0070.01115.86
7.1.80.0120.00615.93
7.1.70.0000.00816.65
7.1.60.0100.00917.60
7.1.50.0120.01525.32
7.1.40.0000.01715.64
7.1.30.0040.01115.88
7.1.20.0090.00615.84
7.1.10.0070.00315.47
7.1.00.0050.04119.21
7.0.330.0070.00715.27
7.0.320.0110.00015.30
7.0.310.0070.00715.43
7.0.300.0150.00015.16
7.0.290.0040.00815.29
7.0.280.0030.01315.09
7.0.270.0090.00315.43
7.0.260.0040.00415.25
7.0.250.0130.00315.30
7.0.240.0100.00315.40
7.0.230.0000.00915.38
7.0.220.0100.00015.46
7.0.210.0090.00615.30
7.0.200.0040.00516.02
7.0.190.0050.00515.24
7.0.180.0000.00814.98
7.0.170.0000.01015.60
7.0.160.0040.00415.55
7.0.150.0040.00815.41
7.0.140.0080.03718.75
7.0.130.0060.00315.53
7.0.120.0080.00415.47
7.0.110.0120.00615.52
7.0.100.0000.01015.47
7.0.90.0090.00615.44
7.0.80.0000.00915.26
7.0.70.0330.02517.55
7.0.60.0250.03217.60
7.0.50.0080.02617.87
7.0.40.0000.02716.69
7.0.30.0050.02516.59
7.0.20.0060.02816.69
7.0.10.0030.02716.87
7.0.00.0070.02016.75
5.6.380.0000.01514.67
5.6.370.0000.00914.32
5.6.360.0030.01314.14
5.6.350.0100.00714.25
5.6.340.0040.00414.23
5.6.330.0090.00614.29
5.6.320.0040.00414.54
5.6.310.0080.00813.96
5.6.300.0040.01214.25
5.6.290.0090.00614.17
5.6.280.0100.03617.58
5.6.270.0070.00714.30
5.6.260.0080.00514.25
5.6.250.0040.01014.41
5.6.240.0070.00714.26
5.6.230.0080.00414.31
5.6.220.0030.02517.52
5.6.210.0060.02417.43
5.6.200.0070.03017.63
5.6.190.0070.02017.69
5.6.180.0050.02717.58
5.6.170.0070.02717.60
5.6.160.0060.02117.60
5.6.150.0070.02217.63
5.6.140.0020.02817.55
5.6.130.0040.02917.79
5.6.120.0060.02117.54
5.6.110.0070.03017.60
5.6.100.0070.03217.79
5.6.90.0090.04517.73
5.6.80.0100.04017.31
5.6.70.0130.03717.46
5.6.60.0070.04517.13
5.6.50.0080.03617.22
5.6.40.0160.03017.18
5.6.30.0140.03817.20
5.6.20.0080.04517.35
5.6.10.0090.03117.30
5.6.00.0080.03317.34
5.5.380.0040.00811.33
5.5.370.0090.00511.04
5.5.360.0010.02615.77
5.5.350.0050.02515.83
5.5.340.0060.02716.20
5.5.330.0030.03216.02
5.5.320.0110.03016.06
5.5.310.0050.02216.05
5.5.300.0050.02015.91
5.5.290.0050.02315.94
5.5.280.0050.02216.14
5.5.270.0030.04815.91
5.5.260.0070.04215.99
5.5.250.0040.03415.93
5.5.240.0080.03615.51
5.5.230.0100.04315.68
5.5.220.0100.03715.59
5.5.210.0100.04215.71
5.5.200.0050.04615.55
5.5.190.0060.04415.74
5.5.180.0060.04815.76
5.5.170.0080.00311.24
5.5.160.0060.02815.55
5.5.150.0100.03915.62
5.5.140.0020.03515.61
5.5.130.0100.03715.78
5.5.120.0030.03615.80
5.5.110.0100.03815.65
5.5.100.0050.04515.62
5.5.90.0050.04515.72
5.5.80.0080.03515.69
5.5.70.0050.04415.60
5.5.60.0090.02315.48
5.5.50.0070.04315.42
5.5.40.0070.04515.33
5.5.30.0110.04015.55
5.5.20.0070.03015.51
5.5.10.0130.02515.64
5.5.00.0130.03615.59
5.4.450.0050.01815.17
5.4.440.0040.02015.23
5.4.430.0050.03515.34
5.4.420.0070.04015.10
5.4.410.0050.03215.26
5.4.400.0070.03715.12
5.4.390.0070.04214.88
5.4.380.0050.03014.84
5.4.370.0090.04014.98
5.4.360.0090.03414.95
5.4.350.0040.03715.18
5.4.340.0100.02215.08
5.4.330.0000.00811.10
5.4.320.0050.03615.11
5.4.310.0080.03714.98
5.4.300.0070.02014.94
5.4.290.0040.03415.07
5.4.280.0060.03415.22
5.4.270.0090.02914.98
5.4.260.0050.04315.04
5.4.250.0110.03815.12
5.4.240.0070.04414.94
5.4.230.0050.04214.87
5.4.220.0070.04215.03
5.4.210.0070.04414.92
5.4.200.0000.04314.97
5.4.190.0080.03414.83
5.4.180.0070.04214.92
5.4.170.0060.02415.08
5.4.160.0160.03214.96
5.4.150.0080.02715.03
5.4.140.0080.03813.88
5.4.130.0080.03313.90
5.4.120.0080.04213.86
5.4.110.0070.03613.64
5.4.100.0070.02513.71
5.4.90.0020.04313.87
5.4.80.0080.04213.80
5.4.70.0080.03613.74
5.4.60.0130.04013.78
5.4.50.0030.04313.67
5.4.40.0090.03013.68
5.4.30.0080.03613.75
5.4.20.0160.03513.85
5.4.10.0070.03213.67
5.4.00.0050.03213.46
5.3.290.0050.02512.69
5.3.280.0070.02212.62
5.3.270.0000.04612.64
5.3.260.0030.04012.70
5.3.250.0100.04312.46
5.3.240.0070.02912.61
5.3.230.0040.04112.57
5.3.220.0050.03312.43
5.3.210.0090.02712.55
5.3.200.0030.04312.58
5.3.190.0040.04112.48
5.3.180.0100.04012.70
5.3.170.0080.04312.62
5.3.160.0070.04112.60
5.3.150.0080.04112.47
5.3.140.0060.02612.43
5.3.130.0060.04412.59
5.3.120.0100.04012.54
5.3.110.0120.03712.60
5.3.100.0050.04112.35
5.3.90.0020.02512.31
5.3.80.0130.03212.31
5.3.70.0070.03712.26
5.3.60.0090.04012.29
5.3.50.0070.03912.22
5.3.40.0070.03712.21
5.3.30.0100.03712.28
5.3.20.0080.03312.14
5.3.10.0030.04011.95
5.3.00.0070.04212.06
5.2.170.0050.01810.89
5.2.160.0030.03510.98
5.2.150.0020.03910.94
5.2.140.0080.02510.87
5.2.130.0070.03310.88
5.2.120.0030.02410.91
5.2.110.0030.02010.77
5.2.100.0050.03410.77
5.2.90.0040.02910.74
5.2.80.0040.03510.77
5.2.70.0090.03210.68
5.2.60.0070.03310.82
5.2.50.0060.03210.83
5.2.40.0070.03210.77
5.2.30.0060.02610.73
5.2.20.0050.03310.65
5.2.10.0050.03510.63
5.2.00.0040.03210.71
5.1.60.0020.03010.40
5.1.50.0050.03210.25
5.1.40.0020.01710.39
5.1.30.0020.02110.55
5.1.20.0040.01810.33
5.1.10.0020.03210.39
5.1.00.0050.03010.35
5.0.50.0040.02210.15
5.0.40.0030.02210.15
5.0.30.0020.03310.15
5.0.20.0020.02410.15
5.0.10.0060.02210.15
5.0.00.0020.02510.15
4.4.90.0020.02210.15
4.4.80.0020.02110.15
4.4.70.0050.01910.15
4.4.60.0030.01710.15
4.4.50.0010.01510.15
4.4.40.0020.01810.15
4.4.30.0010.01010.15
4.4.20.0000.02210.15
4.4.10.0030.01810.15
4.4.00.0020.02710.15
4.3.110.0000.01910.15
4.3.100.0030.02010.15
4.3.90.0030.01710.15
4.3.80.0030.02510.15
4.3.70.0050.01510.15
4.3.60.0020.02310.15
4.3.50.0030.01810.15
4.3.40.0110.01510.15
4.3.30.0040.01810.15
4.3.20.0030.02110.15
4.3.10.0040.01910.15
4.3.00.0030.01510.15

preferences:
50.76 ms | 401 KiB | 5 Q