3v4l.org

run code in 300+ PHP versions simultaneously
<?php function convertFloat($float) { $float = (string)$float; $expPos = strpos($float, 'E-'); if ($expPos === false) { return $float; } $beforeDot = 0; // Well, fuck you my English. $afterDot = 0; // ^^ $numberWithoutPrecision = substr($float, 0, $expPos); $exp = (int)substr($float, $expPos + 1, strlen($float)); $dotPos = strpos($numberWithoutPrecision, '.'); if ($dotPos === false) { $beforeDot = $numberWithoutPrecision; } else { $beforeDot = substr($numberWithoutPrecision, 0, $dotPos); $afterDot = substr($numberWithoutPrecision, $dotPos + 1, strlen($numberWithoutPrecision)); } var_dump($beforeDot, $afterDot); } convertFloat(1.004e-300);

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.00718.31
8.3.50.0130.01121.99
8.3.40.0060.01218.71
8.3.30.0200.00020.34
8.3.20.0040.00420.39
8.3.10.0030.00522.13
8.3.00.0040.00422.43
8.2.180.0060.00918.29
8.2.170.0100.00722.96
8.2.160.0110.00320.52
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0150.00326.16
8.2.120.0040.00419.41
8.2.110.0070.00321.11
8.2.100.0070.00417.78
8.2.90.0000.00917.63
8.2.80.0060.00317.97
8.2.70.0080.00017.80
8.2.60.0040.00418.09
8.2.50.0040.00418.10
8.2.40.0040.00418.16
8.2.30.0040.00417.90
8.2.20.0000.00717.66
8.2.10.0000.00717.73
8.2.00.0120.00017.60
8.1.280.0000.01525.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0070.01519.16
8.1.230.0090.00317.70
8.1.220.0030.00617.74
8.1.210.0080.00018.77
8.1.200.0080.00017.23
8.1.190.0060.00317.23
8.1.180.0040.00418.10
8.1.170.0030.00618.48
8.1.160.0000.00822.13
8.1.150.0040.00418.64
8.1.140.0040.00417.34
8.1.130.0000.00717.87
8.1.120.0000.00717.29
8.1.110.0040.00417.38
8.1.100.0030.00317.30
8.1.90.0000.00717.41
8.1.80.0050.00317.49
8.1.70.0030.00317.34
8.1.60.0040.00417.58
8.1.50.0040.00417.59
8.1.40.0050.00317.52
8.1.30.0030.00617.67
8.1.20.0000.00817.63
8.1.10.0040.00417.39
8.1.00.0000.00717.45
8.0.300.0090.00019.63
8.0.290.0020.00516.63
8.0.280.0050.00218.39
8.0.270.0040.00417.22
8.0.260.0030.00316.76
8.0.250.0070.00016.90
8.0.240.0000.00816.91
8.0.230.0000.00716.89
8.0.220.0070.00016.79
8.0.210.0020.00516.83
8.0.200.0030.00316.86
8.0.190.0070.00016.86
8.0.180.0030.00516.73
8.0.170.0040.00416.88
8.0.160.0040.00416.80
8.0.150.0000.00716.75
8.0.140.0000.00716.77
8.0.130.0050.00013.21
8.0.120.0030.00516.79
8.0.110.0000.00716.72
8.0.100.0040.00416.61
8.0.90.0050.00316.89
8.0.80.0090.01216.79
8.0.70.0000.00816.77
8.0.60.0000.00716.71
8.0.50.0000.00716.76
8.0.30.0140.00717.11
8.0.20.0110.00817.40
8.0.10.0000.00717.06
8.0.00.0150.00416.57
7.4.330.0030.00415.00
7.4.320.0040.00416.55
7.4.300.0060.00016.63
7.4.290.0030.00316.48
7.4.280.0000.00716.50
7.4.270.0050.00316.65
7.4.260.0040.00416.46
7.4.250.0000.00716.52
7.4.240.0020.00516.57
7.4.230.0030.00316.62
7.4.220.0090.01016.47
7.4.210.0080.00716.47
7.4.200.0030.00316.32
7.4.190.0030.00316.64
7.4.160.0090.00916.52
7.4.150.0100.00717.40
7.4.140.0170.00317.86
7.4.130.0090.00816.49
7.4.120.0090.00916.55
7.4.110.0070.01016.50
7.4.100.0060.00816.42
7.4.90.0160.00716.69
7.4.80.0120.00919.39
7.4.70.0130.00316.40
7.4.60.0070.01016.40
7.4.50.0050.00316.56
7.4.40.0060.00922.77
7.4.30.0100.00716.61
7.4.00.0090.00814.88
7.3.330.0030.00313.38
7.3.320.0050.00013.27
7.3.310.0030.00316.29
7.3.300.0040.00416.36
7.3.290.0100.00616.41
7.3.280.0100.00816.32
7.3.270.0130.00317.40
7.3.260.0090.00916.36
7.3.250.0110.01016.34
7.3.240.0140.01116.21
7.3.230.0060.01016.50
7.3.210.0170.00016.52
7.3.200.0060.01219.39
7.3.190.0180.00316.55
7.3.180.0170.00416.25
7.3.170.0120.00616.59
7.3.160.0060.01016.39
7.3.120.0060.01014.80
7.3.110.0060.01014.82
7.3.100.0080.00814.88
7.3.90.0080.01014.80
7.3.80.0050.01014.86
7.3.70.0060.00714.77
7.3.60.0070.00514.84
7.3.50.0030.00814.60
7.3.40.0060.00614.89
7.3.30.0090.00614.72
7.3.20.0060.00816.62
7.3.10.0080.00416.64
7.3.00.0070.00816.68
7.2.330.0140.00316.67
7.2.320.0110.00616.78
7.2.310.0120.01116.74
7.2.300.0000.01716.74
7.2.290.0150.00616.45
7.2.250.0080.01114.93
7.2.240.0080.01014.87
7.2.230.0060.00715.00
7.2.220.0070.00915.01
7.2.210.0070.00615.02
7.2.200.0080.00514.98
7.2.190.0080.00715.09
7.2.180.0030.01115.03
7.2.170.0060.00614.96
7.2.60.0030.01317.02
7.2.00.0000.01419.18
7.1.330.0050.00915.86
7.1.320.0060.00415.77
7.1.310.0100.00615.92
7.1.300.0060.00915.81
7.1.290.0010.01215.73
7.1.280.0060.00715.76
7.1.270.0070.00815.79
7.1.260.0020.01115.79
7.1.200.0030.00715.87
7.1.100.0110.00318.09
7.1.70.0030.00317.19
7.1.60.0120.01219.43
7.1.50.0090.01216.82
7.1.00.0070.05022.31
7.0.200.0070.00316.47
7.0.140.0070.09322.12
7.0.100.0100.06720.01
7.0.90.0430.07319.88
7.0.80.0000.07719.94
7.0.70.0030.05019.88
7.0.60.0070.08319.80
7.0.50.0370.04020.28
7.0.40.0030.04720.09
7.0.30.0030.08320.08
7.0.20.0130.06020.13
7.0.10.0070.07020.12
7.0.00.0070.10020.13
5.6.280.0030.07321.12
5.6.250.0100.04020.56
5.6.240.0030.07320.76
5.6.230.0100.08020.68
5.6.220.0000.04720.48
5.6.210.0030.04320.68
5.6.200.0170.06721.11
5.6.190.0000.08021.04
5.6.180.0000.09321.05
5.6.170.0100.06721.07
5.6.160.0170.07321.01
5.6.150.0130.05321.09
5.6.140.0130.07720.95
5.6.130.0070.06021.02
5.6.120.0100.05021.08
5.6.110.0130.07321.00
5.6.100.0070.04021.16
5.6.90.0100.09021.04
5.6.80.0100.07720.50
5.6.70.0000.05320.43
5.6.60.0100.07020.45
5.6.50.0070.09020.34
5.6.40.0100.04320.41
5.6.30.0030.07720.37
5.6.20.0130.08020.45
5.6.10.0030.08720.48
5.6.00.0200.03720.34
5.5.380.0070.07720.40
5.5.370.0100.08320.50
5.5.360.0100.04320.49
5.5.350.0130.03720.44
5.5.340.0100.08020.78
5.5.330.0130.08020.87
5.5.320.0100.07320.64
5.5.310.0070.04320.93
5.5.300.0130.05720.86
5.5.290.0170.08320.77
5.5.280.0230.04720.90
5.5.270.0070.08320.91
5.5.260.0100.08720.89
5.5.250.0100.06720.70
5.5.240.0000.05020.18
5.5.230.0070.06020.14
5.5.220.0130.07020.26
5.5.210.0030.08020.30
5.5.200.0100.04020.25
5.5.190.0030.04320.11
5.5.180.0000.05320.23
5.5.160.0070.07720.24
5.5.150.0130.04019.99
5.5.140.0100.07320.15
5.5.130.0070.08020.15
5.5.120.0070.04320.22
5.5.110.0030.04020.14
5.5.100.0070.04020.07
5.5.90.0030.04020.16
5.5.80.0070.04320.01
5.5.70.0030.05720.06
5.5.60.0070.03720.00
5.5.50.0030.03320.03
5.5.40.0100.03320.08
5.5.30.0070.03320.14
5.5.20.0070.03720.07
5.5.10.0100.04320.08
5.5.00.0070.03720.12
5.4.450.0030.05719.45
5.4.440.0130.07719.27
5.4.430.0130.08319.34
5.4.420.0030.06719.53
5.4.410.0070.05019.09
5.4.400.0100.04019.21
5.4.390.0030.08019.03
5.4.380.0100.05018.90
5.4.370.0070.08019.22
5.4.360.0130.07319.15
5.4.350.0070.04318.88
5.4.340.0100.07719.03
5.4.320.0170.07019.04
5.4.310.0070.06718.89
5.4.300.0100.07319.20
5.4.290.0070.07719.04
5.4.280.0070.07319.23
5.4.270.0100.03319.14
5.4.260.0030.04019.02
5.4.250.0070.03719.15
5.4.240.0000.04019.20
5.4.230.0000.04019.04
5.4.220.0000.03319.24
5.4.210.0100.02319.12
5.4.200.0070.03019.02
5.4.190.0030.03318.83
5.4.180.0030.03018.89
5.4.170.0000.04319.00
5.4.160.0100.06719.01
5.4.150.0130.02718.83
5.4.140.0070.04016.43
5.4.130.0030.04316.44
5.4.120.0030.03316.46
5.4.110.0070.03016.51
5.4.100.0000.04016.47
5.4.90.0130.04316.29
5.4.80.0100.02716.41
5.4.70.0070.03716.41
5.4.60.0030.03316.36
5.4.50.0030.03316.48
5.4.40.0070.03316.39
5.4.30.0070.03316.32
5.4.20.0070.03016.39
5.4.10.0000.05716.41
5.4.00.0000.03315.68
5.3.290.0070.07714.68
5.3.280.0000.04014.71
5.3.270.0000.06714.59
5.3.260.0030.03714.55
5.3.250.0100.03014.59
5.3.240.0070.04314.58
5.3.230.0030.04314.54
5.3.220.0030.03314.55
5.3.210.0070.04714.71
5.3.200.0030.05314.49
5.3.190.0030.04314.67
5.3.180.0000.04314.68
5.3.170.0030.03714.63
5.3.160.0070.03314.57
5.3.150.0030.04014.65
5.3.140.0000.04014.62
5.3.130.0030.03714.59
5.3.120.0000.03714.49
5.3.110.0030.03714.52
5.3.100.0100.03314.09
5.3.90.0070.03314.05
5.3.80.0030.06714.08
5.3.70.0030.05714.07
5.3.60.0030.03314.06
5.3.50.0070.04013.96
5.3.40.0070.04713.84
5.3.30.0000.04013.79
5.3.20.0030.03713.59
5.3.10.0000.03313.71
5.3.00.0030.03313.65
5.2.170.0000.03711.27
5.2.160.0030.05011.22
5.2.150.0070.02711.25
5.2.140.0030.03711.00
5.2.130.0030.03010.96
5.2.120.0000.03010.98
5.2.110.0070.02311.03
5.2.100.0000.03311.11
5.2.90.0030.02711.12
5.2.80.0000.02711.23
5.2.70.0070.02310.98
5.2.60.0000.03310.93
5.2.50.0000.04011.08
5.2.40.0030.02710.86
5.2.30.0030.04310.88
5.2.20.0070.02310.98
5.2.10.0030.05010.88
5.2.00.0030.06310.78
5.1.60.0070.05010.43
5.1.50.0000.05010.43
5.1.40.0000.02310.43
5.1.30.0030.04310.43
5.1.20.0000.03010.43
5.1.10.0070.05310.43
5.1.00.0030.05710.43
5.0.50.0100.03010.43
5.0.40.0000.04710.43
5.0.30.0030.04310.43
5.0.20.0000.04310.43
5.0.10.0070.03710.43
5.0.00.0070.06010.43
4.4.90.0070.00710.43
4.4.80.0000.01710.43
4.4.70.0000.01710.43
4.4.60.0030.03310.43
4.4.50.0030.03310.43
4.4.40.0030.04310.43
4.4.30.0030.01010.43
4.4.20.0000.03010.43
4.4.10.0070.02310.43
4.4.00.0000.04310.43
4.3.110.0030.02710.43
4.3.100.0030.02310.43
4.3.90.0030.03010.43
4.3.80.0030.03710.43
4.3.70.0030.03310.43
4.3.60.0000.03310.43
4.3.50.0030.02710.43
4.3.40.0030.04710.43
4.3.30.0030.03010.43
4.3.20.0000.03710.43
4.3.10.0030.03710.43
4.3.00.0000.03010.43

preferences:
41.77 ms | 401 KiB | 5 Q