3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Utils { public static function areFloatNumbersEquals($num1, $num2, $precision = 2) { if(!is_int($precision) || $precision < 0 || $precision > 7){ throw new InvalidArgumentException('Invalid param precision'); } $num1 = round((float) $num1, $precision); $num2 = round((float) $num2, $precision); return $num1 == $num2; } } if(Utils::areFloatNumbersEquals(0.054436, 0.054399, 3)){ echo 'equals'; } else { echo 'different'; }

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.0150.00318.80
8.3.30.0070.00718.53
8.3.20.0060.00318.79
8.3.10.0050.00321.09
8.3.00.0040.00423.65
8.2.170.0120.00622.96
8.2.160.0100.01022.21
8.2.150.0030.00524.18
8.2.140.0040.00424.66
8.2.130.0030.00626.16
8.2.120.0040.00421.18
8.2.110.0030.00620.38
8.2.100.0080.00417.72
8.2.90.0070.00019.22
8.2.80.0000.00918.05
8.2.70.0040.00417.75
8.2.60.0000.00818.03
8.2.50.0040.00418.07
8.2.40.0040.00418.21
8.2.30.0030.00519.90
8.2.20.0040.00417.71
8.2.10.0000.00717.61
8.2.00.0080.00017.77
8.1.270.0050.00323.99
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0080.00322.46
8.1.230.0070.00321.02
8.1.220.0080.00018.77
8.1.210.0030.00619.03
8.1.200.0060.00317.23
8.1.190.0000.00717.63
8.1.180.0000.00818.10
8.1.170.0040.00418.44
8.1.160.0000.00818.82
8.1.150.0000.00718.62
8.1.140.0060.00317.38
8.1.130.0030.00317.84
8.1.120.0040.00417.48
8.1.110.0000.00717.40
8.1.100.0000.00817.50
8.1.90.0040.00417.39
8.1.80.0000.00717.49
8.1.70.0040.00417.38
8.1.60.0060.00317.62
8.1.50.0000.00717.46
8.1.40.0040.00417.49
8.1.30.0000.00717.60
8.1.20.0040.00417.61
8.1.10.0000.00817.61
8.1.00.0080.00017.49
8.0.300.0040.00420.21
8.0.290.0000.00717.29
8.0.280.0040.00418.46
8.0.270.0000.00717.31
8.0.260.0000.00616.86
8.0.250.0000.00716.95
8.0.240.0040.00417.03
8.0.230.0030.00316.97
8.0.220.0000.00716.96
8.0.210.0020.00516.92
8.0.200.0040.00416.98
8.0.190.0000.00716.97
8.0.180.0030.00616.96
8.0.170.0000.00716.82
8.0.160.0030.00416.96
8.0.150.0040.00416.79
8.0.140.0070.00016.91
8.0.130.0000.00513.38
8.0.120.0000.00716.82
8.0.110.0040.00416.88
8.0.100.0000.00816.79
8.0.90.0030.00516.93
8.0.80.0040.01217.00
8.0.70.0050.00216.91
8.0.60.0030.00516.82
8.0.50.0060.00316.98
8.0.30.0090.01017.11
8.0.20.0110.00717.40
8.0.10.0040.00416.93
8.0.00.0150.00316.91
7.4.330.0030.00313.43
7.4.320.0030.00316.64
7.4.300.0060.00016.66
7.4.290.0070.00016.66
7.4.280.0030.00816.68
7.4.270.0030.00316.64
7.4.260.0030.00313.34
7.4.250.0000.00716.48
7.4.240.0030.00316.65
7.4.230.0000.00716.61
7.4.220.0060.01016.75
7.4.210.0070.00916.61
7.4.200.0030.00316.66
7.4.190.0070.00016.62
7.4.160.0060.00916.43
7.4.150.0070.01017.40
7.4.140.0090.01217.86
7.4.130.0070.01016.51
7.4.120.0110.00616.48
7.4.110.0070.01016.68
7.4.100.0130.00316.59
7.4.90.0100.00716.65
7.4.80.0110.00519.37
7.4.70.0140.00316.56
7.4.60.0100.00616.54
7.4.50.0060.00316.23
7.4.40.0100.00722.27
7.4.30.0140.00316.65
7.4.00.0050.01414.92
7.3.330.0000.00513.35
7.3.320.0000.00513.30
7.3.310.0070.00016.44
7.3.300.0070.00016.31
7.3.290.0100.00316.26
7.3.280.0050.01016.25
7.3.270.0100.00717.40
7.3.260.0120.00518.24
7.3.250.0130.00716.43
7.3.240.0030.01416.58
7.3.230.0060.01516.39
7.3.210.0090.00916.71
7.3.200.0070.01019.39
7.3.190.0040.01416.23
7.3.180.0100.00516.45
7.3.170.0130.00316.73
7.3.160.0000.01616.65
7.3.120.0090.00814.66
7.3.110.0110.00214.67
7.3.100.0040.01214.56
7.3.90.0070.00914.82
7.3.80.0080.00614.87
7.3.70.0080.00314.62
7.3.60.0050.00714.87
7.3.50.0050.01014.64
7.3.40.0040.00914.50
7.3.30.0070.00714.57
7.3.20.0050.00816.54
7.3.10.0080.00916.43
7.3.00.0080.00516.65
7.2.330.0030.02116.80
7.2.320.0080.00816.73
7.2.310.0160.00716.71
7.2.300.0060.01616.34
7.2.290.0150.00716.57
7.2.250.0070.01315.03
7.2.240.0080.00815.04
7.2.230.0070.00915.05
7.2.220.0060.00614.92
7.2.210.0070.00714.93
7.2.200.0070.00714.94
7.2.190.0050.00915.15
7.2.180.0070.00614.97
7.2.170.0090.00514.96
7.2.00.0080.00519.56
7.1.330.0110.00315.76
7.1.320.0100.00715.78
7.1.310.0100.00515.71
7.1.300.0060.00615.80
7.1.290.0030.00815.74
7.1.280.0050.01015.81
7.1.270.0070.00515.88
7.1.260.0030.00815.86
7.1.200.0060.00615.78
7.1.100.0000.01418.22
7.1.70.0000.00717.14
7.1.60.0140.01019.40
7.1.50.0150.00916.70
7.1.00.0000.04722.43
7.0.200.0030.00616.77
7.0.140.0000.07321.95
7.0.70.0000.07021.74
7.0.60.0070.07721.82
7.0.50.0000.08722.13
7.0.40.0070.07720.07
7.0.30.0070.07319.98
7.0.20.0070.08020.17
7.0.10.0000.06320.01
7.0.00.0030.07020.12
5.6.280.0000.07721.10
5.6.220.0000.06720.63
5.6.210.0000.07320.44
5.6.200.0070.08321.14
5.6.190.0030.08021.17
5.6.180.0100.07721.05
5.6.170.0030.07320.96
5.6.160.0070.05321.17
5.6.150.0070.08321.02
5.6.140.0070.08020.93
5.6.130.0100.07720.95
5.6.120.0070.07321.04
5.6.110.0030.08321.07
5.6.100.0030.07320.99
5.6.90.0030.08021.08
5.6.80.0030.07020.49
5.6.70.0030.07720.33
5.6.60.0000.05320.54
5.6.50.0030.07720.49
5.6.40.0100.07320.29
5.6.30.0030.05320.47
5.6.20.0030.07720.38
5.6.10.0030.07020.52
5.6.00.0000.05020.42
5.5.360.0030.08020.39
5.5.350.0100.07320.41
5.5.340.0100.07020.89
5.5.330.0000.06320.83
5.5.320.0070.07020.85
5.5.310.0100.06020.89
5.5.300.0070.06720.88
5.5.290.0000.06720.80
5.5.280.0100.08320.87
5.5.270.0070.08720.63
5.5.260.0000.08320.91
5.5.250.0070.07320.53
5.5.240.0100.07020.29
5.5.230.0000.08320.20
5.5.220.0130.07020.21
5.5.210.0100.07720.31
5.5.200.0000.07720.26
5.5.190.0000.04020.23
5.5.180.0000.08020.27
5.5.160.0130.07020.20
5.5.150.0070.07720.26
5.5.140.0000.06320.17
5.5.130.0030.08020.14
5.5.120.0030.03720.27
5.5.110.0100.07019.98
5.5.100.0100.06319.95
5.5.90.0030.06320.08
5.5.80.0030.08020.16
5.5.70.0070.07020.07
5.5.60.0070.03720.05
5.5.50.0030.05020.05
5.5.40.0000.04320.05
5.5.30.0000.04320.07
5.5.20.0000.04020.04
5.5.10.0000.04720.07
5.5.00.0000.04020.10
5.4.450.0070.08019.42
5.4.440.0070.07019.43
5.4.430.0100.07319.61
5.4.420.0030.07019.32
5.4.410.0070.07319.21
5.4.400.0000.06719.04
5.4.390.0070.07718.98
5.4.380.0130.06718.90
5.4.370.0030.05319.33
5.4.360.0070.07719.20
5.4.350.0030.07719.20
5.4.340.0070.04319.04
5.4.320.0030.07718.97
5.4.310.0100.06719.12
5.4.300.0000.06719.11
5.4.290.0100.06718.90
5.4.280.0030.07719.21
5.4.270.0030.05319.22
5.4.260.0030.03719.08
5.4.250.0030.07319.08
5.4.240.0030.07719.10
5.4.230.0030.09719.00
5.4.220.0030.08319.03
5.4.210.0100.05719.11
5.4.200.0030.05719.11
5.4.190.0070.05719.19
5.4.180.0000.04019.10
5.4.170.0130.03019.07
5.4.160.0030.03719.18
5.4.150.0000.03318.91
5.4.140.0000.03716.47
5.4.130.0000.04016.43
5.4.120.0000.03016.36
5.4.110.0030.03016.48
5.4.100.0000.03016.53
5.4.90.0030.03316.48
5.4.80.0000.03716.37
5.4.70.0030.03716.39
5.4.60.0030.02716.46
5.4.50.0000.04316.43
5.4.40.0030.03316.52
5.4.30.0000.03316.45
5.4.20.0000.03016.44
5.4.10.0000.03016.36
5.4.00.0000.03315.89
5.3.290.0070.07714.77
5.3.280.0030.07314.77
5.3.270.0070.03314.77
5.3.260.0030.03714.77
5.3.250.0000.03714.77
5.3.240.0000.03714.77
5.3.230.0030.03014.77
5.3.220.0000.03714.77
5.3.210.0000.03714.77
5.3.200.0000.03014.77
5.3.190.0000.03314.77
5.3.180.0000.04714.77
5.3.170.0000.04014.77
5.3.160.0030.02714.77
5.3.150.0000.03014.77
5.3.140.0000.04014.77
5.3.130.0000.03014.77
5.3.120.0000.03014.77
5.3.110.0000.03014.77
5.3.100.0000.03014.77
5.3.90.0000.03014.77
5.3.80.0000.03314.77
5.3.70.0000.03314.77
5.3.60.0030.02714.77
5.3.50.0000.03014.77
5.3.40.0000.03014.77
5.3.30.0030.02714.77
5.3.20.0000.03014.77
5.3.10.0000.02714.77
5.3.00.0000.03014.77
5.2.170.0000.06014.77
5.2.160.0000.02314.77
5.2.150.0030.02314.77
5.2.140.0030.02014.77
5.2.130.0000.02314.77
5.2.120.0030.02014.77
5.2.110.0030.02014.77
5.2.100.0030.02014.77
5.2.90.0000.02314.77
5.2.80.0000.02714.77
5.2.70.0030.02014.77
5.2.60.0000.02714.77
5.2.50.0070.01714.77
5.2.40.0030.02314.77
5.2.30.0000.02314.77
5.2.20.0030.02314.77
5.2.10.0000.02314.77
5.2.00.0000.02314.77
5.1.60.0030.02014.77
5.1.50.0000.02314.77
5.1.40.0000.02714.77
5.1.30.0030.02014.77
5.1.20.0000.02014.77
5.1.10.0000.02314.77
5.1.00.0000.02714.77
5.0.50.0000.01714.77
5.0.40.0030.01714.77
5.0.30.0030.03014.77
5.0.20.0030.02314.77
5.0.10.0000.02014.77
5.0.00.0030.03314.77
4.4.90.0030.01014.77
4.4.80.0000.01314.77
4.4.70.0000.01314.77
4.4.60.0000.02014.77
4.4.50.0030.01014.77
4.4.40.0000.02014.77
4.4.30.0030.01014.77
4.4.20.0000.01314.77
4.4.10.0000.01314.77
4.4.00.0000.02314.77
4.3.110.0000.03714.77
4.3.100.0000.01014.77
4.3.90.0000.01714.77
4.3.80.0000.02314.77
4.3.70.0030.03014.77
4.3.60.0000.01714.77
4.3.50.0000.02014.77
4.3.40.0030.04714.77
4.3.30.0000.01714.77
4.3.20.0000.01314.77
4.3.10.0000.02714.77
4.3.00.0000.02314.77

preferences:
44.35 ms | 400 KiB | 5 Q