3v4l.org

run code in 300+ PHP versions simultaneously
<?php # how i can round 4.3 to 4.5, 4.2 to 4.0, 4.7 to 4.5 and 4.8 to 5.0 ? function bogoround($x) { static $calls = 0; $results = [4.5,4.0,4.5,5.0]; return $results[$calls++]; } var_dump(bogoround(4.3)); var_dump(bogoround(4.2)); var_dump(bogoround(4.7)); var_dump(bogoround(4.8));

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.0080.01118.21
8.3.50.0140.00621.33
8.3.40.0140.00718.97
8.3.30.0070.00720.31
8.3.20.0040.00420.29
8.3.10.0080.00022.15
8.3.00.0000.00722.57
8.2.180.0100.01016.36
8.2.170.0000.01522.96
8.2.160.0070.00722.21
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0050.00320.82
8.2.110.0100.00019.35
8.2.100.0040.00819.45
8.2.90.0040.00417.75
8.2.80.0050.00518.77
8.2.70.0050.00318.03
8.2.60.0080.00017.61
8.2.50.0060.00317.63
8.2.40.0000.00819.35
8.2.30.0040.00417.61
8.2.20.0000.00817.73
8.2.10.0040.00417.71
8.2.00.0080.00017.65
8.1.280.0070.01325.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0040.00428.09
8.1.240.0090.00919.21
8.1.230.0060.00619.16
8.1.220.0080.00017.74
8.1.210.0040.00418.77
8.1.200.0030.00617.22
8.1.190.0000.01017.23
8.1.180.0030.00518.10
8.1.170.0030.00617.65
8.1.160.0040.00418.81
8.1.150.0000.00718.59
8.1.140.0000.00817.38
8.1.130.0000.00717.71
8.1.120.0080.00017.45
8.1.110.0040.00417.50
8.1.100.0000.00817.33
8.1.90.0040.00417.38
8.1.80.0000.00717.40
8.1.70.0000.00817.41
8.1.60.0030.00617.63
8.1.50.0000.00717.61
8.1.40.0030.00517.46
8.1.30.0070.00017.66
8.1.20.0030.00617.63
8.1.10.0040.00417.48
8.1.00.0000.00817.41
8.0.300.0000.00718.77
8.0.290.0040.00416.75
8.0.280.0000.00817.93
8.0.270.0030.00318.01
8.0.260.0030.00316.79
8.0.250.0040.00416.99
8.0.240.0040.00416.84
8.0.230.0030.00316.93
8.0.220.0000.00716.80
8.0.210.0040.00416.81
8.0.200.0040.00416.95
8.0.190.0000.00816.97
8.0.180.0050.00316.95
8.0.170.0040.00416.84
8.0.160.0030.00316.77
8.0.150.0030.00516.70
8.0.140.0000.00716.90
8.0.130.0070.00013.41
8.0.120.0080.00016.81
8.0.110.0000.00716.87
8.0.100.0040.00416.78
8.0.90.0070.00016.94
8.0.80.0040.01116.92
8.0.70.0000.00716.96
8.0.60.0050.00316.93
8.0.50.0000.00716.86
8.0.30.0100.01017.04
8.0.20.0030.01917.40
8.0.10.0070.00016.96
8.0.00.0080.01616.84
7.4.330.0000.00515.01
7.4.320.0030.00316.59
7.4.300.0000.00616.50
7.4.290.0000.00716.54
7.4.280.0000.00716.65
7.4.270.0030.00316.59
7.4.260.0040.00413.23
7.4.250.0040.00416.47
7.4.240.0010.00616.42
7.4.230.0030.00316.49
7.4.220.0110.00816.64
7.4.210.0050.01016.57
7.4.200.0080.00016.62
7.4.190.0070.00016.51
7.4.160.0080.00816.67
7.4.150.0110.00617.40
7.4.140.0090.00717.86
7.4.130.0110.00616.53
7.4.120.0100.00716.52
7.4.110.0090.00916.72
7.4.100.0100.01116.58
7.4.90.0120.00616.55
7.4.80.0110.01119.39
7.4.70.0130.00316.57
7.4.60.0080.00816.55
7.4.50.0060.00316.58
7.4.40.0060.01022.77
7.4.30.0080.01516.29
7.4.00.0110.00615.11
7.3.330.0000.00513.20
7.3.320.0050.00013.19
7.3.310.0040.00416.21
7.3.300.0000.00616.23
7.3.290.0090.00616.15
7.3.280.0050.01016.25
7.3.270.0080.00917.40
7.3.260.0100.00716.63
7.3.250.0130.00416.34
7.3.240.0130.00316.43
7.3.230.0060.01216.39
7.3.210.0090.00916.51
7.3.200.0060.01119.39
7.3.190.0070.01016.43
7.3.180.0060.00916.48
7.3.170.0110.00516.38
7.3.160.0080.00816.21
7.3.120.0090.00814.78
7.3.110.0100.00714.98
7.3.100.0030.00614.75
7.3.90.0140.00314.91
7.3.80.0030.01114.51
7.3.70.0070.00714.48
7.3.60.0070.00714.93
7.3.50.0000.01314.49
7.3.40.0000.00914.64
7.3.30.0000.00914.64
7.3.20.0040.01116.57
7.3.10.0070.00816.08
7.3.00.0050.00516.13
7.2.330.0070.01016.63
7.2.320.0030.01316.43
7.2.310.0130.00916.37
7.2.300.0070.01116.53
7.2.290.0100.00716.72
7.2.250.0130.00715.17
7.2.240.0070.01414.87
7.2.230.0070.01114.95
7.2.220.0070.01015.13
7.2.210.0120.00614.91
7.2.200.0070.00314.87
7.2.190.0040.00815.06
7.2.180.0110.00614.95
7.2.170.0030.01314.66
7.2.130.0050.01016.41
7.2.120.0160.00516.55
7.2.110.0200.00316.25
7.2.100.0150.00616.45
7.2.90.0150.00316.18
7.2.80.0240.00016.16
7.2.70.0070.00716.14
7.2.60.0070.00516.66
7.2.50.0090.00416.68
7.2.40.0030.01016.36
7.2.30.0120.00316.43
7.2.20.0000.01416.51
7.2.10.0050.01016.85
7.2.00.0040.01416.41
7.1.330.0070.00716.04
7.1.320.0070.00715.92
7.1.310.0090.00615.82
7.1.300.0040.01115.75
7.1.290.0040.00415.85
7.1.280.0070.00715.55
7.1.270.0060.00915.72
7.1.260.0060.01015.78
7.1.250.0040.01215.40
7.1.200.0050.00515.75
7.1.70.0070.00017.21
7.1.60.0070.00717.18
7.1.50.0110.01116.72
7.1.00.0030.04322.46
7.0.200.0000.00716.75
7.0.140.0000.07722.00
7.0.100.0130.07719.93
7.0.90.0200.07719.96
7.0.80.0030.05719.98
7.0.70.0030.04020.02
7.0.60.0030.04019.95
7.0.50.0130.03720.30
7.0.40.0030.03320.09
7.0.30.0030.03720.13
7.0.20.0070.03320.11
7.0.10.0030.04320.03
7.0.00.0000.04720.12
5.6.280.0030.07021.04
5.6.250.0030.07320.59
5.6.240.0030.05720.59
5.6.230.0030.05720.63
5.6.220.0030.04320.61
5.6.210.0070.03720.43
5.6.200.0000.04720.96
5.6.190.0030.04021.04
5.6.180.0030.04321.04
5.6.170.0030.03321.14
5.6.160.0100.04321.08
5.6.150.0000.05021.04
5.6.140.0130.07721.05
5.6.130.0030.03721.17
5.6.120.0070.04721.17
5.6.110.0000.04021.17
5.6.100.0070.03021.07
5.6.90.0130.03321.03
5.6.80.0070.03020.40
5.6.70.0100.03320.55
5.6.60.0070.03020.43
5.6.50.0100.03020.46
5.6.40.0030.03320.39
5.6.30.0030.03320.35
5.6.20.0070.03320.41
5.6.10.0000.03720.39
5.6.00.0000.04020.45
5.5.380.0070.03720.46
5.5.370.0070.07720.42
5.5.360.0000.04720.39
5.5.350.0130.03320.45
5.5.340.0070.04020.76
5.5.330.0030.03320.74
5.5.320.0030.04320.79
5.5.310.0030.03320.90
5.5.300.0170.07720.92
5.5.290.0030.04020.91
5.5.280.0030.03720.86
5.5.270.0070.03320.90
5.5.260.0070.03320.79
5.5.250.0100.03720.67
5.5.240.0100.03320.25
5.5.230.0030.03720.15
5.5.220.0030.03320.27
5.5.210.0030.03720.29
5.5.200.0070.03020.16
5.5.190.0000.03720.13
5.5.180.0030.03320.24
5.5.160.0000.03720.27
5.5.150.0030.03720.08
5.5.140.0030.04320.21
5.5.130.0030.03320.27
5.5.120.0030.03320.15
5.5.110.0030.03320.07
5.5.100.0070.03020.08
5.5.90.0070.03020.01
5.5.80.0070.03020.16
5.5.70.0070.03020.12
5.5.60.0070.03319.96
5.5.50.0030.03720.10
5.5.40.0000.03720.14
5.5.30.0030.03320.09
5.5.20.0030.03720.01
5.5.10.0070.05719.97
5.5.00.0070.04320.02
5.4.450.0000.05719.23
5.4.440.0030.03719.36
5.4.430.0030.03319.21
5.4.420.0000.04319.53
5.4.410.0100.03719.23
5.4.400.0070.03019.04
5.4.390.0000.03719.18
5.4.380.0000.03318.85
5.4.370.0070.03019.05
5.4.360.0000.03319.09
5.4.350.0030.03319.16
5.4.340.0000.03718.91
5.4.320.0000.03719.13
5.4.310.0000.03319.09
5.4.300.0000.03319.11
5.4.290.0000.03319.13
5.4.280.0030.03019.12
5.4.270.0000.03319.12
5.4.260.0030.03319.02
5.4.250.0070.02719.05
5.4.240.0030.03319.20
5.4.230.0000.03319.04
5.4.220.0030.03019.18
5.4.210.0000.03319.04
5.4.200.0030.04319.12
5.4.190.0030.07019.04
5.4.180.0070.03019.08
5.4.170.0030.04019.13
5.4.160.0030.03719.11
5.4.150.0070.06718.87
5.4.140.0000.03716.33
5.4.130.0070.07016.41
5.4.120.0030.06716.24
5.4.110.0130.04016.37
5.4.100.0000.04016.51
5.4.90.0030.06316.43
5.4.80.0030.06716.48
5.4.70.0070.04016.32
5.4.60.0070.07016.33
5.4.50.0030.04016.44
5.4.40.0000.07016.45
5.4.30.0130.06716.41
5.4.20.0030.07016.36
5.4.10.0000.03716.39
5.4.00.0030.05315.94
5.3.290.0000.03314.59
5.3.280.0000.03314.68
5.3.270.0100.07014.58
5.3.260.0030.03714.70
5.3.250.0100.07014.56
5.3.240.0030.03714.54
5.3.230.0030.03314.63
5.3.220.0000.04014.62
5.3.210.0100.04314.51
5.3.200.0000.05314.62
5.3.190.0030.04714.54
5.3.180.0030.04714.50
5.3.170.0000.05014.70
5.3.160.0070.06014.45
5.3.150.0070.04314.59
5.3.140.0070.07014.66
5.3.130.0000.08014.56
5.3.120.0030.03714.57
5.3.110.0070.03314.64
5.3.100.0000.03714.10
5.3.90.0070.03314.14
5.3.80.0100.02714.14
5.3.70.0030.06714.11
5.3.60.0070.04313.89
5.3.50.0000.08013.88
5.3.40.0030.05013.87
5.3.30.0100.02314.01
5.3.20.0100.04713.71
5.3.10.0070.06013.71
5.3.00.0000.07713.66
5.2.170.0030.05311.02
5.2.160.0030.03711.07
5.2.150.0000.03311.19
5.2.140.0000.05711.14
5.2.130.0000.05011.16
5.2.120.0030.05311.10
5.2.110.0000.05711.01
5.2.100.0070.02311.20
5.2.90.0000.02711.16
5.2.80.0000.06710.98
5.2.70.0100.05711.21
5.2.60.0030.03011.03
5.2.50.0030.02710.90
5.2.40.0130.04711.09
5.2.30.0100.04011.11
5.2.20.0000.05311.07
5.2.10.0070.04310.91
5.2.00.0000.05310.57
5.1.60.0000.0239.98
5.1.50.0070.04010.00
5.1.40.0100.03710.04
5.1.30.0030.05710.42
5.1.20.0030.05310.34
5.1.10.0070.05010.20
5.1.00.0170.04310.10
5.0.50.0030.0438.66
5.0.40.0000.0408.51
5.0.30.0000.0308.32
5.0.20.0000.0208.25
5.0.10.0070.0438.25
5.0.00.0070.0438.25
4.4.90.0030.0308.25
4.4.80.0000.0138.25
4.4.70.0000.0278.25
4.4.60.0070.0278.25
4.4.50.0000.0308.25
4.4.40.0000.0238.25
4.4.30.0030.0108.25
4.4.20.0000.0138.25
4.4.10.0030.0138.25
4.4.00.0030.0208.25
4.3.110.0030.0308.25
4.3.100.0000.0338.25
4.3.90.0000.0378.25
4.3.80.0030.0208.25
4.3.70.0000.0178.25
4.3.60.0000.0138.25
4.3.50.0000.0138.25
4.3.40.0000.0478.25
4.3.30.0000.0178.25
4.3.20.0030.0308.25
4.3.10.0000.0238.25
4.3.00.0000.0138.25

preferences:
39.62 ms | 401 KiB | 5 Q