3v4l.org

run code in 300+ PHP versions simultaneously
<?php $arr = array(74.6779,25.918,44.9589); $total = array_sum($arr); $total_percentage = 0; foreach($arr as $total_item) { $percentage = ($total_item*100)/$total; $percentage = round($percentage,2); // without this works, but result large numbers.. e.g: "51.305693800548" echo $percentage; echo "\n"; $total_percentage+=$percentage; } echo round($total_percentage,2);

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.0000.01518.83
8.3.30.0140.00019.40
8.3.20.0040.00420.32
8.3.10.0060.00320.54
8.3.00.0030.00619.51
8.2.170.0030.01422.96
8.2.160.0150.00320.49
8.2.150.0070.00024.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0080.00020.97
8.2.110.0060.00322.29
8.2.100.0090.00317.91
8.2.90.0050.00220.58
8.2.80.0080.00017.97
8.2.70.0050.00318.05
8.2.60.0030.00618.05
8.2.50.0040.00418.13
8.2.40.0040.00420.47
8.2.30.0000.00819.60
8.2.20.0040.00417.72
8.2.10.0040.00418.09
8.2.00.0070.00017.80
8.1.270.0000.00823.92
8.1.260.0070.00026.35
8.1.250.0040.00428.09
8.1.240.0000.00923.99
8.1.230.0110.00020.88
8.1.220.0040.00417.88
8.1.210.0050.00319.12
8.1.200.0050.00817.35
8.1.190.0050.00317.36
8.1.180.0030.00518.10
8.1.170.0040.00418.47
8.1.160.0040.00422.09
8.1.150.0040.00418.86
8.1.140.0000.00817.45
8.1.130.0030.00417.64
8.1.120.0070.00017.45
8.1.110.0040.00417.50
8.1.100.0020.00517.40
8.1.90.0040.00417.45
8.1.80.0040.00417.53
8.1.70.0000.00817.40
8.1.60.0060.00317.50
8.1.50.0030.00517.47
8.1.40.0000.00817.59
8.1.30.0000.00917.59
8.1.20.0030.00617.78
8.1.10.0040.00417.63
8.1.00.0000.00717.40
8.0.300.0040.00419.82
8.0.290.0070.00016.75
8.0.280.0030.00318.55
8.0.270.0070.00017.25
8.0.260.0000.00716.79
8.0.250.0000.00816.98
8.0.240.0080.00016.88
8.0.230.0030.00317.05
8.0.220.0040.00416.84
8.0.210.0030.00316.82
8.0.200.0030.00316.95
8.0.190.0090.00017.07
8.0.180.0000.00816.90
8.0.170.0040.00416.91
8.0.160.0050.00317.02
8.0.150.0070.00016.85
8.0.140.0000.00816.93
8.0.130.0030.00313.38
8.0.120.0000.00917.02
8.0.110.0040.00416.93
8.0.100.0070.00016.99
8.0.90.0050.00316.98
8.0.80.0070.01016.94
8.0.70.0040.00416.91
8.0.60.0000.00816.78
8.0.50.0000.00817.06
8.0.30.0110.01017.02
8.0.20.0090.01117.40
8.0.10.0040.00417.05
8.0.00.0120.00816.71
7.4.330.0050.00015.24
7.4.320.0030.00316.49
7.4.300.0060.00016.52
7.4.290.0000.00816.54
7.4.280.0030.00516.66
7.4.270.0030.00316.67
7.4.260.0000.00716.67
7.4.250.0040.00416.61
7.4.240.0040.00416.67
7.4.230.0030.00516.69
7.4.220.0160.00616.58
7.4.210.0000.01516.52
7.4.200.0030.00516.40
7.4.160.0130.00316.48
7.4.150.0090.00917.40
7.4.140.0080.01117.86
7.4.130.0110.00716.53
7.4.120.0100.00816.61
7.4.110.0160.00916.39
7.4.100.0070.01016.37
7.4.90.0100.00716.41
7.4.80.0110.01119.39
7.4.70.0030.01416.39
7.4.60.0000.01616.47
7.4.50.0030.00516.43
7.4.40.0040.01516.49
7.4.30.0060.00916.42
7.4.00.0060.00915.00
7.3.330.0000.00613.23
7.3.320.0030.00313.13
7.3.310.0030.00316.48
7.3.300.0060.00016.30
7.3.290.0060.01016.43
7.3.280.0090.01016.34
7.3.270.0070.01017.40
7.3.260.0060.01116.36
7.3.250.0110.00816.60
7.3.240.0120.00816.34
7.3.230.0060.01016.39
7.3.210.0090.00916.50
7.3.200.0060.00919.39
7.3.190.0070.01016.31
7.3.180.0090.00616.46
7.3.170.0160.00616.59
7.3.160.0030.01216.43
7.2.330.0070.01016.59
7.2.320.0060.00916.43
7.2.310.0100.00716.60
7.2.300.0150.00916.73
7.2.290.0070.01416.82
7.2.60.0090.00616.67
7.2.00.0100.00319.60
7.1.200.0080.00315.71
7.1.100.0040.00718.26
7.1.70.0040.00416.89
7.1.60.0130.01319.46
7.1.50.0070.01317.12
7.1.00.0070.07322.45
7.0.200.0030.00616.45
7.0.140.0070.07022.11
7.0.60.0030.08320.07
7.0.50.0000.04317.86
7.0.40.0070.06320.23
7.0.30.0530.06720.01
7.0.20.0330.08020.21
7.0.10.0130.04720.16
7.0.00.0200.07320.00
5.6.280.0070.07021.09
5.6.210.0270.06020.56
5.6.200.0000.05018.18
5.6.190.0030.06320.39
5.6.180.0130.04720.50
5.6.170.0300.08320.57
5.6.160.0070.08320.51
5.6.150.0100.07018.09
5.6.140.0070.06018.09
5.6.130.0100.08318.21
5.6.120.0100.06321.05
5.6.110.0130.06321.02
5.6.100.0030.04721.10
5.6.90.0170.07320.97
5.6.80.0070.06320.38
5.6.70.4230.03320.39
5.5.350.0030.07320.52
5.5.340.0130.06018.02
5.5.330.0030.07020.19
5.5.320.0470.06320.27
5.5.310.0030.06720.50
5.5.300.0130.07018.02
5.5.290.0070.06717.95
5.5.280.0070.04320.80
5.5.270.0030.05320.88
5.5.260.0070.04320.96
5.5.250.0130.08020.69
5.5.240.0270.05720.26
5.4.450.0130.04719.57
5.4.440.0130.04719.39
5.4.430.0070.03319.51
5.4.420.0070.03319.48
5.4.410.0300.03719.08
5.4.400.0170.04018.86
5.4.390.0170.04018.80
5.4.380.0370.05318.68
5.4.370.0300.05318.63
5.4.360.0570.04318.73
5.4.350.0200.06018.67
5.4.340.0330.06718.76
5.4.320.0050.03812.46
5.4.310.0060.03812.45
5.4.300.0110.03112.46
5.4.290.0100.03312.46
5.4.280.0060.03512.36
5.4.270.0080.03412.35
5.4.260.0060.03712.36
5.4.250.0060.03712.36
5.4.240.0050.03612.35
5.4.230.0030.04012.34
5.4.220.0020.03912.34
5.4.210.0070.03312.34
5.4.200.0090.03312.35
5.4.190.0040.03912.34
5.4.180.0070.04812.34
5.4.170.0070.05012.35
5.4.160.0040.03712.35
5.4.150.0050.03612.34
5.4.140.0040.03812.03
5.4.130.0030.03912.02
5.4.120.0080.03311.98
5.4.110.0060.03911.97
5.4.100.0060.03611.97
5.4.90.0070.04211.97
5.4.80.0050.03711.97
5.4.70.0080.03511.96
5.4.60.0070.03511.97
5.4.50.0060.04011.96
5.4.40.0050.03611.95
5.4.30.0060.03611.95
5.4.20.0050.03611.96
5.4.10.0070.03611.96
5.4.00.0040.03811.45
5.3.290.0060.04812.80
5.3.280.0070.04012.70
5.3.270.0060.04312.72
5.3.260.0070.04212.72
5.3.250.0020.04212.72
5.3.240.0040.04012.72
5.3.230.0070.03712.71
5.3.220.0070.03612.68
5.3.210.0080.04012.68
5.3.200.0040.03912.68
5.3.190.0060.03812.68
5.3.180.0090.03412.68
5.3.170.0070.03512.66
5.3.160.0060.03712.68
5.3.150.0070.03612.68
5.3.140.0070.03612.66
5.3.130.0070.03812.66
5.3.120.0080.03712.66
5.3.110.0050.04012.66
5.3.100.0040.03912.12
5.3.90.0080.03812.08
5.3.80.0080.04912.07
5.3.70.0080.03612.07
5.3.60.0040.04312.06
5.3.50.0070.04212.00
5.3.40.0070.03612.00
5.3.30.0080.03611.95
5.3.20.0080.03511.73
5.3.10.0070.03311.69
5.3.00.0090.03211.68
5.2.170.0020.0349.20
5.2.160.0040.0299.20
5.2.150.0050.0299.20
5.2.140.0090.0259.19
5.2.130.0030.0309.15
5.2.120.0050.0279.15
5.2.110.0060.0279.16
5.2.100.0070.0279.16
5.2.90.0090.0369.16
5.2.80.0070.0279.15
5.2.70.0030.0319.16
5.2.60.0010.0339.11
5.2.50.0030.0319.07
5.2.40.0040.0299.05
5.2.30.0060.0279.03
5.2.20.0070.0269.02
5.2.10.0090.0248.97
5.2.00.0070.0278.83
5.1.60.0050.0258.11
5.1.50.0020.0278.11
5.1.40.0040.0268.09
5.1.30.0010.0298.45
5.1.20.0010.0298.46
5.1.10.0030.0268.18
5.1.00.0040.0258.19
5.0.50.0030.0216.66
5.0.40.0020.0206.52
5.0.30.0040.0306.34
5.0.20.0030.0196.32
5.0.10.0040.0236.30
5.0.00.0060.0286.30
4.4.90.0020.0164.78
4.4.80.0020.0154.76
4.4.70.0020.0164.75
4.4.60.0020.0164.75
4.4.50.0050.0134.77
4.4.40.0020.0264.71
4.4.30.0020.0184.76
4.4.20.0030.0144.84
4.4.10.0010.0174.85
4.4.00.0020.0254.76
4.3.110.0040.0144.66
4.3.100.0020.0154.66
4.3.90.0020.0154.63
4.3.80.0010.0344.59
4.3.70.0030.0144.63
4.3.60.0050.0124.63
4.3.50.0030.0154.63
4.3.40.0020.0254.54
4.3.30.0040.0143.35
4.3.20.0020.0163.33
4.3.10.0000.0203.29
4.3.00.0000.02014.95

preferences:
37.09 ms | 400 KiB | 5 Q