3v4l.org

run code in 300+ PHP versions simultaneously
<?php echo convert_fraction_to_decimal('3 1/16'); function convert_fraction_to_decimal( $fraction_string){ $fraction_string_array = explode( $fraction_string, ' '); print_r($fraction_string_array); $whole_number = $fraction_string_array[0]; $fraction_number = $fraction_string_array[1]; $fraction_decimal = 0; if( $fraction_number != 0){ $fraction_number_array = explode($fraction_number, '/'); $fraction_decimal = $fraction_number_array[0] / $fraction_number_array[1]; } $return_number = $fraction_number + $fraction_decimal; return $return_number; }

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.110.0130.00318.41
8.3.100.0030.00618.43
8.3.90.0090.00918.33
8.3.80.0040.00718.43
8.3.70.0170.00316.73
8.3.60.0100.00618.68
8.3.50.0140.00520.97
8.3.40.0150.00018.71
8.3.30.0070.00719.14
8.3.20.0040.00420.35
8.3.10.0000.00823.65
8.3.00.0040.00419.37
8.2.230.0060.00320.94
8.2.220.0000.00924.06
8.2.210.0090.00926.77
8.2.200.0070.00318.68
8.2.190.0100.00316.58
8.2.180.0080.00818.67
8.2.170.0090.00622.96
8.2.160.0100.01020.38
8.2.150.0030.00524.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0000.00821.08
8.2.110.0100.00022.27
8.2.100.0060.00617.63
8.2.90.0030.00518.98
8.2.80.0000.00817.97
8.2.70.0030.00617.63
8.2.60.0000.01118.05
8.2.50.0090.00018.07
8.2.40.0040.00418.34
8.2.30.0060.00318.01
8.2.20.0000.00817.92
8.2.10.0040.00418.05
8.2.00.0000.00717.71
8.1.290.0080.00018.88
8.1.280.0110.00325.92
8.1.270.0000.00823.87
8.1.260.0000.00726.35
8.1.250.0090.00028.09
8.1.240.0060.00324.03
8.1.230.0060.00619.21
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.35
8.1.190.0080.00017.10
8.1.180.0000.00818.10
8.1.170.0050.00318.33
8.1.160.0000.00821.92
8.1.150.0040.00418.93
8.1.140.0060.00317.49
8.1.130.0040.00417.73
8.1.120.0050.00217.37
8.1.110.0040.00417.36
8.1.100.0000.00717.36
8.1.90.0000.00717.47
8.1.80.0000.00717.38
8.1.70.0000.00717.37
8.1.60.0060.00317.47
8.1.50.0040.00417.42
8.1.40.0000.00717.54
8.1.30.0030.00617.68
8.1.20.0040.00417.65
8.1.10.0040.00417.56
8.1.00.0030.00617.55
8.0.300.0000.00718.77
8.0.290.0000.00716.75
8.0.280.0040.00418.39
8.0.270.0030.00317.26
8.0.260.0000.00717.24
8.0.250.0030.00316.93
8.0.240.0040.00416.99
8.0.230.0030.00316.90
8.0.220.0040.00416.84
8.0.210.0040.00416.96
8.0.200.0030.00317.01
8.0.190.0080.00016.99
8.0.180.0040.00416.96
8.0.170.0000.00716.85
8.0.160.0040.00416.95
8.0.150.0050.00216.87
8.0.140.0000.00716.98
8.0.130.0060.00013.43
8.0.120.0080.00016.81
8.0.110.0070.00016.95
8.0.100.0000.00716.83
8.0.90.0070.00016.79
8.0.80.0120.00616.97
8.0.70.0080.00016.74
8.0.60.0040.00416.86
8.0.50.0050.00317.02
8.0.30.0190.00417.11
8.0.20.0130.00617.40
8.0.10.0000.00817.07
8.0.00.0110.00816.61
7.4.330.0020.00215.02
7.4.320.0000.00916.59
7.4.300.0030.00316.60
7.4.290.0030.00316.48
7.4.280.0040.00416.58
7.4.270.0000.00716.59
7.4.260.0000.00716.35
7.4.250.0000.00716.41
7.4.240.0050.00216.53
7.4.230.0000.00716.70
7.4.220.0030.01316.41
7.4.210.0120.00316.52
7.4.200.0030.00316.39
7.4.160.0090.00616.48
7.4.150.0090.00817.40
7.4.140.0100.01217.86
7.4.130.0130.00516.49
7.4.120.0130.00616.54
7.4.110.0080.00816.50
7.4.100.0060.01216.48
7.4.90.0070.01116.69
7.4.80.0120.00619.39
7.4.70.0070.01016.52
7.4.60.0030.01316.50
7.4.50.0020.00216.53
7.4.40.0100.00616.55
7.4.30.0070.01416.38
7.4.00.0110.00415.11
7.3.330.0000.00513.38
7.3.320.0030.00313.45
7.3.310.0070.00016.45
7.3.300.0000.00716.47
7.3.290.0100.00616.38
7.3.280.0090.00716.34
7.3.270.0130.00517.40
7.3.260.0160.00016.43
7.3.250.0070.00916.54
7.3.240.0140.00416.61
7.3.230.0030.01416.40
7.3.210.0100.00616.50
7.3.200.0060.00919.39
7.3.190.0100.01016.58
7.3.180.0060.01316.43
7.3.170.0130.01016.50
7.3.160.0040.01216.43
7.3.10.0100.01016.55
7.3.00.0150.01116.45
7.2.330.0140.00416.46
7.2.320.0060.01216.32
7.2.310.0110.00616.55
7.2.300.0120.00416.50
7.2.290.0140.00516.46
7.2.130.0070.01116.50
7.2.120.0120.00916.83
7.2.110.0120.01416.29
7.2.100.0110.00816.48
7.2.90.0110.01116.43
7.2.80.0190.01016.91
7.2.70.0100.01016.51
7.2.60.0100.01016.56
7.2.50.0100.00716.73
7.2.40.0070.01016.60
7.2.30.0070.01416.57
7.2.20.0180.00416.50
7.2.10.0110.00816.71
7.2.00.0090.00718.14
7.1.250.0190.00315.91
7.1.100.0080.00317.81
7.1.70.0030.00516.93
7.1.60.0160.00319.32
7.1.50.0160.00717.01
7.1.00.0030.07722.48
7.0.200.0030.00616.51
7.0.140.0070.07022.09
7.0.60.0030.08020.04
7.0.50.0070.08017.85
7.0.40.0030.04720.23
7.0.30.0330.07020.29
7.0.20.0230.07720.07
7.0.10.0200.05320.07
7.0.00.0100.05320.05
5.6.280.0030.07321.16
5.6.210.0030.07320.50
5.6.200.0070.07318.13
5.6.190.0100.04320.52
5.6.180.0130.05320.46
5.6.170.0330.04020.49
5.6.160.0070.08320.71
5.6.150.0100.07718.16
5.6.140.0000.04018.28
5.6.130.0030.04018.22
5.6.120.0100.04321.02
5.6.110.0130.08320.98
5.6.100.0130.08021.01
5.6.90.0070.06720.99
5.6.80.0070.07720.29
5.6.70.0170.05720.44
5.5.350.0070.06320.45
5.5.340.0100.07717.95
5.5.330.0030.04020.25
5.5.320.0030.04720.38
5.5.310.0170.05320.28
5.5.300.0070.03718.07
5.5.290.0000.06017.98
5.5.280.0100.03720.90
5.5.270.0230.07320.64
5.5.260.0030.05020.64
5.5.250.0070.05720.69
5.5.240.0130.07020.29
5.4.450.0800.07719.47
5.4.440.0800.06719.48
5.4.430.0870.04719.48
5.4.420.0770.05319.64
5.4.410.0070.05719.57
5.4.400.0970.05019.31
5.4.390.0170.04719.15
5.4.380.0730.06319.26
5.4.370.0270.05019.16
5.4.360.0900.05719.15
5.4.350.0970.05719.16
5.4.340.0040.03712.02
5.4.320.0070.03612.50
5.4.310.0030.04112.50
5.4.300.0040.03912.50
5.4.290.0060.04412.50
5.4.280.0040.03712.39
5.4.270.0100.03212.40
5.4.260.0080.03612.40
5.4.250.0060.04012.39
5.4.240.0080.03412.40
5.4.230.0040.03912.39
5.4.220.0060.03512.39
5.4.210.0040.03612.39
5.4.200.0070.03612.39
5.4.190.0070.03412.38
5.4.180.0040.03812.39
5.4.170.0060.03512.39
5.4.160.0060.03612.39
5.4.150.0060.03512.39
5.4.140.0040.03812.07
5.4.130.0050.03612.05
5.4.120.0030.03812.02
5.4.110.0060.03512.01
5.4.100.0110.03112.01
5.4.90.0030.03912.01
5.4.80.0040.03812.01
5.4.70.0070.03312.00
5.4.60.0030.03712.01
5.4.50.0040.03712.01
5.4.40.0050.03612.00
5.4.30.0050.03611.99
5.4.20.0110.02911.99
5.4.10.0040.03611.99
5.4.00.0060.03511.48
5.3.290.0080.04012.80
5.3.280.0050.04012.71
5.3.270.0050.04112.72
5.3.260.0060.03812.72
5.3.250.0120.03012.72
5.3.240.0060.03612.72
5.3.230.0070.03612.71
5.3.220.0040.03812.68
5.3.210.0050.03912.68
5.3.200.0070.03912.68
5.3.190.0070.03612.68
5.3.180.0070.03512.67
5.3.170.0060.03712.67
5.3.160.0070.03512.67
5.3.150.0080.03512.67
5.3.140.0100.03312.66
5.3.130.0070.03712.66
5.3.120.0060.03812.66
5.3.110.0070.03812.66
5.3.100.0050.03712.12
5.3.90.0070.03512.10
5.3.80.0080.03412.09
5.3.70.0090.03912.09
5.3.60.0090.03712.07
5.3.50.0060.03612.02
5.3.40.0070.03512.02
5.3.30.0090.03511.98
5.3.20.0090.03511.76
5.3.10.0070.03411.73
5.3.00.0080.03411.71
5.2.170.0020.0339.21
5.2.160.0070.0269.21
5.2.150.0020.0329.21
5.2.140.0050.0299.21
5.2.130.0030.0309.17
5.2.120.0020.0349.17
5.2.110.0070.0279.18
5.2.100.0100.0229.17
5.2.90.0070.0269.17
5.2.80.0030.0319.17
5.2.70.0010.0339.17
5.2.60.0060.0289.13
5.2.50.0080.0269.10
5.2.40.0070.0269.07
5.2.30.0060.0289.05
5.2.20.0040.0299.04
5.2.10.0080.0258.94
5.2.00.0040.0298.80
5.1.60.0040.0248.09
5.1.50.0030.0278.08
5.1.40.0070.0218.06
5.1.30.0050.0248.42
5.1.20.0020.0288.43
5.1.10.0020.0288.16
5.1.00.0030.0268.16
5.0.50.0030.0216.64
5.0.40.0020.0206.50
5.0.30.0030.0316.31
5.0.20.0050.0176.28
5.0.10.0030.0196.26
5.0.00.0020.0326.25
4.4.90.0030.0154.78
4.4.80.0060.0114.76
4.4.70.0030.0154.76
4.4.60.0020.0154.75
4.4.50.0010.0164.77
4.4.40.0020.0284.71
4.4.30.0040.0134.76
4.4.20.0020.0164.84
4.4.10.0030.0144.85
4.4.00.0030.0244.75
4.3.110.0030.0154.67
4.3.100.0040.0144.66
4.3.90.0060.0174.64
4.3.80.0030.0244.58
4.3.70.0030.0144.63
4.3.60.0000.0174.62
4.3.50.0040.0144.63
4.3.40.0020.0254.53
4.3.30.0020.0163.30
4.3.20.0010.0173.28
4.3.10.0010.0163.24
4.3.00.0170.0276.78

preferences:
65.14 ms | 403 KiB | 5 Q