3v4l.org

run code in 300+ PHP versions simultaneously
<?php $diffs = []; $unexpectedTraditional = $unexpectedNew = 0; foreach (range(1, 99999) as $i) { $float = $i / 100; $multiple1 = $float * 100; $multiple2 = (float) (string) ($float * 100); $int1 = (int) $multiple1; $int2 = (int) $multiple2; if ($int1 !== $int2) { $diffs[] = $i; if ($int1 !== $i) { $unexpectedTraditional++; } if ($int2 !== $i) { $unexpectedNew++; } } } echo 'Unexpected count traditional approach: '.$unexpectedTraditional."\n"; echo 'Unexpected count new approach: '.$unexpectedNew."\n"; //echo 'Differences for:'."\n"; //var_dump($diffs);

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.0170.04718.13
8.3.50.0130.06920.28
8.3.40.0130.04320.34
8.3.30.0100.04420.34
8.3.20.0070.02321.66
8.3.10.0100.02024.09
8.3.00.0060.02225.51
8.2.180.0070.04820.50
8.2.170.0070.04822.96
8.2.160.0160.03624.07
8.2.150.0100.04624.18
8.2.140.0030.02824.66
8.2.130.0070.02320.92
8.2.120.0030.02626.35
8.2.110.0070.03022.14
8.2.100.0100.03219.84
8.2.90.0100.03020.57
8.2.80.0030.03419.13
8.2.70.0100.02919.13
8.2.60.0000.03719.55
8.2.50.0060.03219.91
8.2.40.0000.03622.01
8.2.30.0090.02820.92
8.2.20.0030.03419.86
8.2.10.0060.03119.67
8.2.00.0060.03219.83
8.1.280.0170.05625.92
8.1.270.0100.02125.47
8.1.260.0040.02528.04
8.1.250.0100.02028.09
8.1.240.0040.03224.09
8.1.230.0040.03923.43
8.1.220.0060.03220.90
8.1.210.0070.03320.48
8.1.200.0000.04320.50
8.1.190.0070.03320.25
8.1.180.0030.03820.78
8.1.170.0100.02921.82
8.1.160.0030.03621.89
8.1.150.0100.02723.15
8.1.140.0070.03322.48
8.1.130.0030.03523.77
8.1.120.0000.03720.61
8.1.110.0060.03220.50
8.1.100.0030.03620.56
8.1.90.0070.03120.66
8.1.80.0070.03020.61
8.1.70.0060.03220.52
8.1.60.0000.03920.76
8.1.50.0040.03620.71
8.1.40.0070.03320.57
8.1.30.0040.03620.79
8.1.20.0030.03520.73
8.1.10.0070.04020.57
8.1.00.0100.02820.66
8.0.300.0030.03921.97
8.0.290.0000.04619.88
8.0.280.0100.03421.44
8.0.270.0030.04120.03
8.0.260.0030.04221.38
8.0.250.0000.04219.95
8.0.240.0030.04119.89
8.0.230.0060.03819.89
8.0.220.0060.03719.92
8.0.210.0100.03419.94
8.0.200.0000.04519.97
8.0.190.0000.04519.91
8.0.180.0000.04519.85
8.0.170.0030.04219.85
8.0.160.0030.04220.02
8.0.150.0030.04119.79
8.0.140.0000.04419.87
8.0.130.0000.04216.43
8.0.120.0030.04119.91
8.0.110.0000.04619.87
8.0.100.0070.03719.76
8.0.90.0030.04119.77
8.0.80.0130.05419.87
8.0.70.0070.03719.74
8.0.60.0070.03819.82
8.0.50.0000.04419.93
8.0.30.0120.05520.15
8.0.20.0180.06920.00
8.0.10.0070.03720.03
8.0.00.0030.09319.70
7.4.330.0070.04116.44
7.4.320.0000.04419.59
7.4.300.0070.03719.45
7.4.290.0060.03819.49
7.4.280.0030.04119.50
7.4.270.0060.04519.62
7.4.260.0070.03619.50
7.4.250.0030.04019.47
7.4.240.0000.04319.59
7.4.230.0070.03719.64
7.4.220.0070.07919.54
7.4.210.0060.07219.64
7.4.200.0030.04119.62
7.4.160.0130.05319.43
7.4.150.0100.06519.52
7.4.140.0150.07719.52
7.4.130.0170.09019.63
7.4.120.0130.06519.55
7.4.110.0130.06519.46
7.4.100.0200.08519.50
7.4.90.0100.09519.63
7.4.80.0160.06619.61
7.4.70.0180.05319.63
7.4.60.0100.07619.53
7.4.50.0100.05319.72
7.4.40.0100.06419.66
7.4.30.0130.06319.71
7.4.00.0130.05317.91
7.3.330.0030.03916.30
7.3.320.0000.04216.21
7.3.310.0030.04019.30
7.3.300.0100.03419.20
7.3.290.0120.07019.30
7.3.280.0140.06619.31
7.3.270.0160.05619.36
7.3.260.0180.07419.23
7.3.250.0200.06619.54
7.3.240.0110.06219.41
7.3.230.0070.06519.56
7.3.210.0130.05719.48
7.3.200.0100.06519.36
7.3.190.0130.08819.49
7.3.180.0150.08319.51
7.3.170.0160.06119.63
7.3.160.0180.08519.29
7.3.10.0070.05320.34
7.3.00.0070.06320.61
7.2.330.0140.06119.56
7.2.320.0130.05919.47
7.2.310.0160.06019.59
7.2.300.0160.05519.83
7.2.290.0130.05719.77
7.2.130.0000.06820.55
7.2.120.0030.06920.62
7.2.110.0130.06020.67
7.2.100.0060.05520.73
7.2.90.0030.06920.38
7.2.80.0130.06220.58
7.2.70.0000.06820.81
7.2.60.0070.05220.63
7.2.50.0030.06020.47
7.2.40.0000.07020.74
7.2.30.0030.05420.71
7.2.20.0060.06820.59
7.2.10.0000.05820.54
7.2.00.0030.06620.34
7.1.250.0070.06519.40
7.1.200.0030.04119.59
7.1.100.2450.07020.79
7.1.90.2220.05620.54
7.1.80.2620.06020.48
7.1.70.2450.06719.55
7.1.60.3590.06337.91
7.1.50.3110.06937.50
7.1.40.2900.07037.27
7.1.30.2920.05837.22
7.1.20.3390.08637.46
7.1.10.4030.07219.18
7.1.00.1970.06619.29
7.0.240.2350.05920.27
7.0.230.2510.06120.59
7.0.220.2580.07720.50
7.0.210.1980.05319.17
7.0.200.2950.06319.45
7.0.190.3040.08019.46
7.0.180.3090.07918.87
7.0.170.2750.07418.87
7.0.160.3860.08218.94
7.0.150.3580.07218.88
7.0.140.2150.06019.25
7.0.130.0530.07119.25
7.0.120.0600.07719.22
7.0.110.2270.07117.60
7.0.100.1310.07618.58
7.0.90.2390.06817.45
7.0.80.2640.08218.83
7.0.70.1620.07817.40
7.0.60.1290.06817.07
7.0.50.3400.05617.36
7.0.40.2240.06319.15
7.0.30.0270.09019.24
7.0.20.0470.08019.09
7.0.10.1870.07619.20
7.0.00.5660.06617.62

preferences:
69.07 ms | 400 KiB | 5 Q