3v4l.org

run code in 300+ PHP versions simultaneously
<?php $number = 3.0000000000000002; $precision = 8; $delta = 0.1 ** $precision; $rounded = round($number, $precision); if (abs($number -$rounded) < $delta) { $roundedResult = intval($number); } if ((int) $number == $number){ $intedResult = (int) $number; } echo "Rounded result: ".$roundedResult.PHP_EOL; echo "Inted result: ".$intedResult.PHP_EOL;

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.0100.01016.75
8.3.50.0100.00922.12
8.3.40.0090.00618.77
8.3.30.0070.00719.21
8.3.20.0080.00020.49
8.3.10.0080.00023.96
8.3.00.0000.00820.88
8.2.180.0000.01618.41
8.2.170.0070.01122.96
8.2.160.0110.00622.27
8.2.150.0030.00524.18
8.2.140.0060.00324.66
8.2.130.0080.00026.16
8.2.120.0070.00722.33
8.2.110.0050.00522.50
8.2.100.0090.00317.97
8.2.90.0000.00819.22
8.2.80.0050.00317.97
8.2.70.0080.00017.75
8.2.60.0080.00018.17
8.2.50.0060.00318.07
8.2.40.0000.00818.28
8.2.30.0030.00518.16
8.2.20.0040.00417.88
8.2.10.0000.00919.77
8.2.00.0000.00718.00
8.1.280.0140.00425.92
8.1.270.0000.00822.44
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0090.00024.07
8.1.230.0100.00019.41
8.1.220.0000.00817.78
8.1.210.0050.00318.77
8.1.200.0030.00717.50
8.1.190.0030.00617.54
8.1.180.0050.00318.10
8.1.170.0000.00818.75
8.1.160.0050.00222.34
8.1.150.0000.00718.80
8.1.140.0040.00417.61
8.1.130.0000.00718.04
8.1.120.0000.00817.71
8.1.110.0050.00217.61
8.1.100.0000.00717.69
8.1.90.0000.00717.62
8.1.80.0050.00317.63
8.1.70.0030.00317.65
8.1.60.0000.00817.66
8.1.50.0000.00817.66
8.1.40.0060.00317.76
8.1.30.0040.00417.86
8.1.20.0000.00717.81
8.1.10.0000.00817.73
8.1.00.0040.00417.61
8.0.300.0000.00718.77
8.0.290.0030.00317.40
8.0.280.0000.00818.64
8.0.270.0000.00717.52
8.0.260.0000.00718.88
8.0.250.0030.00317.19
8.0.240.0000.00817.18
8.0.230.0070.00017.08
8.0.220.0000.00716.97
8.0.210.0000.00717.17
8.0.200.0030.00617.04
8.0.190.0070.00017.23
8.0.180.0030.00417.04
8.0.170.0030.00617.06
8.0.160.0040.00417.13
8.0.150.0060.00316.97
8.0.140.0000.00717.07
8.0.130.0000.00613.55
8.0.120.0040.00417.07
8.0.110.0000.00716.99
8.0.100.0000.00716.95
8.0.90.0040.00417.16
8.0.80.0040.01116.95
8.0.70.0070.00016.97
8.0.60.0040.00416.89
8.0.50.0070.00016.84
8.0.30.0110.00917.23
8.0.20.0080.01417.43
8.0.10.0040.00417.15
8.0.00.0100.00716.92
7.4.330.0000.00615.25
7.4.320.0000.00616.80
7.4.300.0040.00416.64
7.4.290.0050.00516.84
7.4.280.0030.00316.70
7.4.270.0050.00316.71
7.4.260.0000.00816.69
7.4.250.0070.00016.63
7.4.240.0010.00616.79
7.4.230.0000.00716.59
7.4.220.0070.01216.82
7.4.210.0050.01016.67
7.4.200.0070.00016.84
7.4.190.0080.00016.75
7.4.160.0120.00416.71
7.4.150.0080.01417.40
7.4.140.0110.00617.86
7.4.130.0120.00716.75
7.4.120.0120.00516.68
7.4.110.0060.01216.75
7.4.100.0030.02016.67
7.4.90.0060.01616.84
7.4.80.0100.00616.60
7.4.70.0130.00316.68
7.4.60.0140.00616.71
7.4.50.0000.00416.82
7.4.40.0030.01322.77
7.4.30.0060.01016.73
7.4.00.0080.00615.03
7.3.330.0050.00013.22
7.3.320.0000.00513.30
7.3.310.0030.00316.43
7.3.300.0000.00716.41
7.3.290.0090.00616.39
7.3.280.0100.00816.44
7.3.270.0170.00617.40
7.3.260.0070.01116.46
7.3.250.0110.00616.69
7.3.240.0060.01016.47
7.3.230.0100.00716.45
7.3.210.0130.00316.69
7.3.200.0110.01119.39
7.3.190.0110.01116.53
7.3.180.0180.00416.58
7.3.170.0110.01116.74
7.3.160.0060.01016.55
7.3.120.0000.01615.03
7.3.110.0070.00614.92
7.3.100.0090.00615.21
7.3.90.0000.00915.23
7.3.80.0000.01215.09
7.3.70.0060.00614.98
7.3.60.0080.00415.06
7.3.50.0060.00615.08
7.3.40.0030.01114.59
7.3.30.0090.00615.06
7.3.20.0040.00816.96
7.3.10.0000.01616.64
7.3.00.0030.01016.68
7.2.330.0070.01116.90
7.2.320.0090.00916.53
7.2.310.0030.01416.89
7.2.300.0090.00816.87
7.2.290.0100.00716.84
7.2.250.0070.01015.08
7.2.240.0100.01015.30
7.2.230.0100.00715.06
7.2.220.0030.00615.28
7.2.210.0100.00315.11
7.2.200.0030.00614.97
7.2.190.0070.01015.32
7.2.180.0040.00815.36
7.2.170.0090.00315.26
7.2.60.0740.00317.25
7.2.50.0000.01317.25
7.1.330.0120.00315.96
7.1.320.0040.00816.06
7.1.310.0030.00715.77
7.1.300.0040.01115.99
7.1.290.0070.00715.95
7.1.280.0000.01216.20
7.1.270.0030.00916.04
7.1.260.0000.01315.86
7.1.200.0100.00315.99
7.1.100.0040.01118.46
7.1.70.0000.00817.02
7.1.60.0100.01419.29
7.1.50.0130.01017.09
7.1.00.0000.07722.52
7.0.200.0060.00617.10
7.0.140.0070.06722.33
7.0.60.0030.09020.00
7.0.50.0070.05017.98
7.0.40.0000.06720.32
7.0.30.0300.07020.21
7.0.20.0300.07320.16
7.0.10.0100.04020.16
7.0.00.0070.04320.31
5.6.280.0030.07721.18
5.6.210.0070.07720.75
5.6.200.0030.04018.26
5.6.190.0100.07720.80
5.6.180.0100.04320.68
5.6.170.0230.04020.68
5.6.160.0030.08720.54
5.6.150.0030.05318.41
5.6.140.0130.07018.23
5.6.130.0000.07318.23
5.6.120.0170.06721.36
5.6.110.0170.08321.10
5.6.100.0070.05021.14
5.6.90.0100.08721.25
5.6.80.0030.04020.67
5.5.350.0070.08320.42
5.5.340.0070.07317.96
5.5.330.0030.04320.57
5.5.320.0270.03320.37
5.5.310.0570.07720.30
5.5.300.0070.05017.98
5.5.290.0100.08318.08
5.5.280.0000.07720.68
5.5.270.0030.04020.64
5.5.260.0130.07320.77
5.5.250.0100.07720.69
5.5.240.0030.07020.26
5.4.450.1300.06319.49
5.4.440.0270.05319.57
5.4.430.0270.05019.45
5.4.420.0130.06319.53
5.4.410.0270.06019.09
5.4.400.0470.05318.54
5.4.390.0500.04718.80
5.4.380.0130.05318.80
5.4.370.0100.06018.74
5.4.360.0070.05718.64
5.4.350.0130.06018.56
5.4.340.0070.05718.75
5.4.320.0020.04312.50
5.4.310.0090.04112.50
5.4.300.0060.03612.50
5.4.290.0040.03912.50
5.4.280.0040.04812.39
5.4.270.0060.04612.39
5.4.260.0070.03512.39
5.4.250.0050.03712.39
5.4.240.0040.03612.39
5.4.230.0350.08712.37
5.4.220.0190.04612.37
5.4.210.0470.08012.36
5.4.200.0330.09812.37
5.4.190.0330.10012.36
5.4.180.0320.09512.36
5.4.170.0310.09012.37
5.4.160.0390.08712.37
5.4.150.0330.09112.36
5.4.140.0410.08512.06
5.4.130.0410.09112.03
5.4.120.0500.09612.01
5.4.110.0330.08912.00
5.4.100.0250.06812.00
5.4.90.0150.04312.00
5.4.80.0190.04412.00
5.4.70.0380.08111.99
5.4.60.0360.08412.00
5.4.50.0370.08811.99
5.4.40.0400.09711.98
5.4.30.0350.08611.97
5.4.20.0330.04911.97
5.4.10.0230.04711.97
5.4.00.0320.08711.46
5.3.290.0080.04212.80
5.3.280.0220.07312.71
5.3.270.0390.09012.72
5.3.260.0360.08712.72
5.3.250.0300.09612.72
5.3.240.0420.08512.72
5.3.230.0340.09212.71
5.3.220.0410.09012.68
5.3.210.0480.07812.68
5.3.200.0340.08712.68
5.3.190.0350.06212.68
5.3.180.0230.04212.67
5.3.170.0160.05212.66
5.3.160.0160.04812.67
5.3.150.0320.06312.67
5.3.140.0190.04512.66
5.3.130.0170.05312.66
5.3.120.0180.04412.66
5.3.110.0190.04912.66
5.3.100.0140.04812.12
5.3.90.0350.09312.08
5.3.80.0200.05012.07
5.3.70.0320.06412.07
5.3.60.0160.04612.06
5.3.50.0190.04312.00
5.3.40.0340.09212.00
5.3.30.0130.04511.94
5.3.20.0180.04411.71
5.3.10.0170.04111.67
5.3.00.0140.04611.65
5.2.170.0140.0359.16
5.2.160.0130.0359.16
5.2.150.0170.0339.16
5.2.140.0330.0789.16
5.2.130.0190.0319.12
5.2.120.0170.0329.12
5.2.110.0160.0349.13
5.2.100.0280.0579.13
5.2.90.0140.0429.11
5.2.80.0220.0309.11
5.2.70.0160.0349.11
5.2.60.0190.0339.07
5.2.50.0310.0539.04
5.2.40.0140.0349.01
5.2.30.0140.0348.98
5.2.20.0140.0338.98
5.2.10.0250.0798.91
5.2.00.0120.0358.75
5.1.60.0280.0758.04
5.1.50.0140.0308.04
5.1.40.0100.0308.03
5.1.30.0110.0318.37
5.1.20.0100.0328.41
5.1.10.0110.0348.12
5.1.00.0160.0288.12
5.0.50.0070.0276.61
5.0.40.0090.0236.46
5.0.30.0090.0376.27
5.0.20.0080.0566.27
5.0.10.0130.0216.24
5.0.00.0080.0386.23
4.4.90.0110.0164.78
4.4.80.0090.0184.75
4.4.70.0070.0194.76
4.4.60.0090.0174.75
4.4.50.0100.0144.77
4.4.40.0090.0314.70
4.4.30.0080.0244.75
4.4.20.0110.0174.85
4.4.10.0050.0224.85
4.4.00.0120.0254.76
4.3.110.0070.0204.67
4.3.100.0250.0614.66
4.3.90.0080.0164.63
4.3.80.0070.0284.58
4.3.70.0070.0174.63
4.3.60.0090.0164.63
4.3.50.0070.0194.63
4.3.40.0100.0244.54
4.3.30.0060.0183.30
4.3.20.0080.0173.29
4.3.10.0030.0203.25
4.3.00.0070.01312.79

preferences:
34.61 ms | 401 KiB | 5 Q