3v4l.org

run code in 300+ PHP versions simultaneously
<?php do{ $a = mt_rand(5, 75); $b = mt_rand(5, 75); $adjuster = mt_rand(2, 20); $decimal_selector = mt_rand(1, 6); if ($decimal_selector == 1){ $a = $a / 10; $b = $b / 10; } if ($decimal_selector == 2){ $a = $a / 10; $b = $b / 100; } if ($decimal_selector == 3){ $a = $a / 100; $b = $b / 10; } if ($decimal_selector == 4){ $a = $a / 100; $b = $b / 100; } if ($decimal_selector == 5){ $a = $a / 1000; $b = $b / 1000; } if ($decimal_selector == 6){ $a = $a / 1000; $b = $b / 100; } if($b < $a){ $b = $b + ($a - $b) + $adjuster; } echo "a: $a. b: $b. "; $c = $b - $a; if(round($c) == $c) { $c_is_int = 1; echo "c: $c (is int!)\n"; } else { $c_is_int = 0; echo "c: $c (is NOT int!)\n"; } } while($c_is_int == 1);

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)
7.4.10.0100.01015.11
7.4.00.0080.01015.10
7.3.130.0060.00614.95
7.3.120.0070.01114.88
7.3.110.0070.01014.76
7.3.100.0070.00714.82
7.3.90.0030.00815.00
7.3.80.0060.01014.93
7.3.70.0090.00514.59
7.3.60.0060.00414.93
7.3.50.0070.00714.71
7.3.40.0080.00814.91
7.3.30.0060.00814.79
7.3.20.0040.01116.57
7.3.10.0090.00716.58
7.3.00.0060.00716.66
7.2.260.0060.01215.09
7.2.250.0090.01014.95
7.2.240.0050.01315.00
7.2.230.0070.00814.93
7.2.220.0070.00715.07
7.2.210.0030.01314.94
7.2.200.0050.01114.88
7.2.190.0040.00914.96
7.2.180.0050.00814.92
7.2.170.0050.01014.96
7.2.160.0030.01315.03
7.2.150.0030.01416.64
7.2.140.0030.00716.81
7.2.130.0030.00616.77
7.2.120.0090.00616.52
7.2.110.0030.01016.88
7.2.100.0100.00717.04
7.2.90.0070.01116.70
7.2.80.0070.01116.62
7.2.70.0090.00616.89
7.2.60.0040.00816.77
7.2.50.0000.01416.66
7.2.40.0040.00816.78
7.2.30.0130.00016.65
7.2.20.0030.00717.05
7.2.10.0060.01016.89
7.2.00.0020.01017.99
7.1.330.0050.01116.05
7.1.320.0100.00515.77
7.1.310.0060.00815.70
7.1.300.0070.00415.67
7.1.290.0100.00615.81
7.1.280.0030.01015.62
7.1.270.0020.01115.71
7.1.260.0090.00615.69
7.1.250.0030.00915.88
7.1.240.0060.00916.00
7.1.230.0060.00915.71
7.1.220.0120.00615.96
7.1.210.0070.00715.76
7.1.200.0090.00615.71
7.1.190.0100.00015.91
7.1.180.0070.00315.56
7.1.170.0090.00615.89
7.1.160.0080.00416.00
7.1.150.0060.00615.79
7.1.140.0060.00615.95
7.1.130.0000.01515.91
7.1.120.0050.00515.85
7.1.110.0100.00315.61
7.1.100.0030.01015.82
7.1.90.0070.01015.70
7.1.80.0040.01115.83
7.1.70.0060.00516.60
7.1.60.0050.01017.61
7.1.50.0050.01316.49
7.1.40.0030.01215.79
7.1.30.0070.00715.75
7.1.20.0030.00715.88
7.1.10.0040.01115.80
7.1.00.0010.03119.17
7.0.330.0000.00815.34
7.0.320.0100.00715.25
7.0.310.0100.00715.39
7.0.300.0060.00615.37
7.0.290.0040.01115.50
7.0.280.0040.00815.61
7.0.270.0060.00915.29
7.0.260.0110.00315.24
7.0.250.0080.00415.43
7.0.240.0040.01115.46
7.0.230.0070.00715.55
7.0.220.0070.01015.39
7.0.210.0030.01415.41
7.0.200.0090.00315.99
7.0.190.0060.00915.55
7.0.180.0000.01315.46
7.0.170.0000.01115.59
7.0.160.0090.00615.22
7.0.150.0000.01215.51
7.0.140.0080.03618.63
7.0.130.0040.00415.55
7.0.120.0080.01518.94
7.0.110.0040.00715.48
7.0.100.0000.00815.57
7.0.90.0050.00515.34
7.0.80.0080.00815.41
7.0.70.0030.01015.29
7.0.60.0030.02517.69
7.0.50.0080.03716.72
7.0.40.0170.02516.88
7.0.30.0100.02716.81
7.0.20.0150.02316.81
7.0.10.0120.02816.86
7.0.00.0130.02816.93
5.6.400.0090.00614.23
5.6.390.0070.00714.29
5.6.380.0060.00614.24
5.6.370.0070.00714.20
5.6.360.0040.01114.25
5.6.350.0030.00914.37
5.6.340.0040.00414.41
5.6.330.0080.00314.60
5.6.320.0070.01014.20
5.6.310.0040.01214.50
5.6.300.0130.00314.30
5.6.290.0040.00714.51
5.6.280.0050.03917.70
5.6.270.0040.01214.18
5.6.260.0090.00614.66
5.6.250.0040.01114.29
5.6.240.0150.00014.41
5.6.230.0060.00614.47
5.6.220.0130.00014.32
5.6.210.0050.02317.61
5.6.200.0080.04616.26
5.6.190.0170.02917.31
5.6.180.0160.02517.34
5.6.170.0130.02717.44
5.6.160.0150.02217.34
5.6.150.0150.02317.28
5.6.140.0130.02717.37
5.6.130.0120.02617.39
5.6.120.0150.02317.29
5.6.110.0170.02317.30
5.6.100.0170.02217.32
5.6.90.0080.03017.17
5.6.80.0120.02817.01
5.6.70.0180.03716.86
5.6.60.0240.02616.88
5.6.50.0130.04916.96
5.6.40.0200.04416.91
5.6.30.0250.03417.02
5.6.20.0240.03716.91
5.6.10.0170.04417.00
5.6.00.0180.03516.99
5.5.380.0120.00414.24
5.5.370.0030.00914.32
5.5.360.0060.00614.14
5.5.350.0090.03917.47
5.5.340.0030.04016.03
5.5.330.0170.02617.17
5.5.320.0110.02517.21
5.5.310.0080.02917.30
5.5.300.0140.02417.34
5.5.290.0130.02517.14
5.5.280.0100.02717.18
5.5.270.0120.02316.92
5.5.260.0150.02717.19
5.5.250.0160.04316.99
5.5.240.0150.04016.96
5.5.230.0180.03416.85
5.5.220.0180.03016.76
5.5.210.0150.03916.74
5.5.200.0130.03916.57
5.5.190.0160.03116.76
5.5.180.0200.02016.99
5.5.170.0030.00914.36
5.5.160.0230.03816.93
5.5.150.0270.03517.01
5.5.140.0200.03716.93
5.5.130.0200.04116.79
5.5.120.0180.04016.86
5.5.110.0180.03916.87
5.5.100.0200.03616.58
5.5.90.0190.03716.93
5.5.80.0200.04216.75
5.5.70.0190.04116.64
5.5.60.0200.04016.90
5.5.50.0270.03516.59
5.5.40.0230.03216.88
5.5.30.0170.03816.91
5.5.20.0150.03716.92
5.5.10.0230.03516.77
5.5.00.0230.03716.82
5.4.450.0110.02315.21
5.4.440.0100.02515.02
5.4.430.0120.02015.08
5.4.420.0130.02115.23
5.4.410.0120.02215.11
5.4.400.0150.04015.19
5.4.390.0190.03314.90
5.4.380.0170.04215.09
5.4.370.0150.02614.97
5.4.360.0180.03814.99
5.4.350.0270.03014.90
5.4.340.0180.03514.76
5.4.330.0000.00811.15
5.4.320.0140.03014.95
5.4.310.0150.03214.94
5.4.300.0150.03314.97
5.4.290.0130.03415.00
5.4.280.0200.03814.94
5.4.270.0180.04215.16
5.4.260.0350.03015.08
5.4.250.0150.03315.11
5.4.240.0200.03315.14
5.4.230.0150.02515.04
5.4.220.0160.02814.98
5.4.210.0180.03814.94
5.4.200.0180.03815.01
5.4.190.0200.03514.87
5.4.180.0220.03115.12
5.4.170.0130.02814.82
5.4.160.0150.04114.90
5.4.150.0150.04214.72
5.4.140.0180.04213.71
5.4.130.0190.03013.72
5.4.120.0170.03413.48
5.4.110.0130.02513.59
5.4.100.0130.02813.76
5.4.90.0170.03513.60
5.4.80.0200.03513.60
5.4.70.0230.03313.64
5.4.60.0200.03313.60
5.4.50.0190.03713.80
5.4.40.0150.03713.47
5.4.30.0230.02613.51
5.4.20.0240.02513.59
5.4.10.0210.03913.58
5.4.00.0230.03113.33
5.3.290.0150.03212.59
5.3.280.0280.02312.52
5.3.270.0180.03812.59
5.3.260.0180.04012.66
5.3.250.0130.03312.61
5.3.240.0170.03812.60
5.3.230.0150.04312.59
5.3.220.0230.03312.53
5.3.210.0190.03612.51
5.3.200.0200.03812.55
5.3.190.0170.02412.51
5.3.180.0170.03012.57
5.3.170.0170.03612.55
5.3.160.0150.04112.55
5.3.150.0200.03812.53
5.3.140.0170.04012.50
5.3.130.0300.02812.51
5.3.120.0180.02812.57
5.3.110.0150.04212.53
5.3.100.0170.04212.25
5.3.90.0170.03312.25
5.3.80.0180.03812.24
5.3.70.0180.04012.24
5.3.60.0220.03612.18
5.3.50.0130.04012.20
5.3.40.0210.02912.14
5.3.30.0170.02712.18
5.3.20.0220.03212.02
5.3.10.0200.03212.05
5.3.00.0220.02812.09
5.2.170.0230.04013.01
5.2.160.0300.05013.01
5.2.150.0300.05313.01
5.2.140.0200.04313.01
5.2.130.0270.04013.01
5.2.120.0230.04313.01
5.2.110.0230.04713.01
5.2.100.0300.04713.01
5.2.90.0200.04313.01
5.2.80.0300.03313.01
5.2.70.0230.05013.01
5.2.60.0300.05713.01
5.2.50.0230.06013.01
5.2.40.0200.06013.01
5.2.30.0170.06313.01
5.2.20.0170.05013.01
5.2.10.0200.06313.01
5.2.00.0200.05013.01
5.1.60.0200.04713.01
5.1.50.0170.05313.01
5.1.40.0230.04713.01
5.1.30.0200.06013.01
5.1.20.0200.03313.01
5.1.10.0270.04313.01
5.1.00.0270.03313.01
5.0.50.0130.03713.01
5.0.40.0170.03713.01
5.0.30.0130.05713.01
5.0.20.0100.04313.01
5.0.10.0070.03713.01
5.0.00.0170.05713.01
4.4.90.0130.03313.01
4.4.80.0170.03013.01
4.4.70.0100.02713.01
4.4.60.0100.02713.01
4.4.50.0100.02713.01
4.4.40.0070.03313.01
4.4.30.0130.03013.01
4.4.20.0070.04013.01
4.4.10.0170.02013.01
4.4.00.0230.03713.01
4.3.110.0130.03713.01
4.3.100.0130.03013.01
4.3.90.0130.02713.01
4.3.80.0070.05013.01
4.3.70.0100.03313.01
4.3.60.0130.02313.01
4.3.50.0100.02713.01
4.3.40.0100.04713.01
4.3.30.0070.03713.01
4.3.20.0070.03313.01
4.3.10.0070.03013.01
4.3.00.0030.03313.01

preferences:
37.84 ms | 401 KiB | 5 Q