3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getGridStepForValue(float $c, int $minCountLines): float { $config = [15, 5, 2, 1]; $n = ceil($c); $length = \strlen((string)$n); while ($length) { foreach ($config as $singleDivisor) { $nDivisor = (float)str_pad((string)$singleDivisor, $length, '0'); if ($n - ($nDivisor * $minCountLines) > 0) { return $nDivisor; } } $length--; } return getGridStepForValue($c * 10, $minCountLines) / 10; } var_dump(getGridStepForValue(1, 4), getGridStepForValue(1, 5));

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.0060.01218.30
8.3.50.0140.00716.50
8.3.40.0130.01018.63
8.3.30.0120.00318.79
8.3.20.0040.00422.04
8.3.10.0030.00523.64
8.3.00.0000.00822.09
8.2.180.0090.00916.32
8.2.170.0130.00722.96
8.2.160.0120.00818.90
8.2.150.0040.00424.18
8.2.140.0040.00424.66
8.2.130.0040.00419.46
8.2.120.0080.00026.35
8.2.110.0000.00920.96
8.2.100.0080.00317.91
8.2.90.0030.00520.07
8.2.80.0050.00318.28
8.2.70.0040.00418.05
8.2.60.0000.00817.75
8.2.50.0000.01018.16
8.2.40.0050.00220.63
8.2.30.0040.00422.55
8.2.20.0030.00618.01
8.2.10.0000.00718.12
8.2.00.0040.00418.20
8.1.280.0060.00925.92
8.1.270.0050.00222.23
8.1.260.0000.00726.35
8.1.250.0080.00028.09
8.1.240.0060.00322.55
8.1.230.0060.00620.99
8.1.220.0000.00817.89
8.1.210.0040.00418.77
8.1.200.0000.00817.35
8.1.190.0030.00517.35
8.1.180.0000.00818.10
8.1.170.0040.00418.79
8.1.160.0020.00519.01
8.1.150.0040.00420.34
8.1.140.0050.00217.68
8.1.130.0050.00319.36
8.1.120.0000.00717.54
8.1.110.0000.00717.40
8.1.100.0040.00417.53
8.1.90.0000.00717.43
8.1.80.0040.00417.47
8.1.70.0030.00517.50
8.1.60.0060.00317.66
8.1.50.0070.00017.48
8.1.40.0040.00417.59
8.1.30.0090.00017.55
8.1.20.0040.00417.77
8.1.10.0060.00317.66
8.1.00.0060.00317.46
8.0.300.0050.00220.01
8.0.290.0000.00716.88
8.0.280.0000.00818.43
8.0.270.0000.00717.40
8.0.260.0000.00716.96
8.0.250.0030.00317.07
8.0.240.0050.00317.11
8.0.230.0030.00316.96
8.0.220.0040.00416.96
8.0.210.0030.00316.94
8.0.200.0030.00616.98
8.0.190.0000.00717.14
8.0.180.0040.00416.97
8.0.170.0080.00017.05
8.0.160.0000.00817.03
8.0.150.0070.00016.86
8.0.140.0040.00416.96
8.0.130.0030.00313.41
8.0.120.0050.00217.03
8.0.110.0000.01316.96
8.0.100.0000.00716.93
8.0.90.0040.00417.04
8.0.80.0100.01017.06
8.0.70.0000.00716.93
8.0.60.0070.00017.07
8.0.50.0040.00417.14
8.0.30.0090.00717.04
8.0.20.0120.00917.40
8.0.10.0000.00717.00
8.0.00.0060.01116.84
7.4.330.0020.00215.55
7.4.320.0040.00416.48
7.4.300.0040.00416.66
7.4.290.0000.01016.56
7.4.280.0060.00316.50
7.4.270.0000.00816.57
7.4.260.0030.00316.65
7.4.250.0070.00016.59
7.4.240.0040.00416.68
7.4.230.0050.00316.79
7.4.220.0070.00016.76
7.4.210.0050.00816.62
7.4.200.0030.00316.57
7.4.160.0090.00716.58
7.4.140.0100.01117.86
7.4.130.0030.01316.62
7.4.120.0090.01016.55
7.4.110.0100.01616.62
7.4.100.0100.01016.50
7.4.90.0080.01216.84
7.4.80.0150.00919.39
7.4.70.0040.01816.58
7.4.60.0070.00716.44
7.4.50.0070.00716.43
7.4.40.0040.01816.76
7.4.00.0070.01015.01
7.3.330.0030.00313.23
7.3.320.0000.00613.13
7.3.310.0000.00716.27
7.3.300.0000.00716.23
7.3.290.0040.00416.38
7.3.280.0080.00716.37
7.3.260.0120.00816.52
7.3.240.0090.00716.48
7.3.230.0150.00616.51
7.3.210.0070.01016.61
7.3.200.0060.00916.36
7.3.190.0100.00516.42
7.3.180.0090.00916.57
7.3.170.0130.00916.47
7.3.160.0050.01016.58
7.3.120.0030.01714.80
7.3.110.0070.01114.85
7.3.100.0100.00314.89
7.3.90.0040.01114.94
7.3.80.0030.00814.81
7.3.70.0030.00614.71
7.3.60.0070.00314.89
7.3.50.0030.00714.86
7.3.40.0030.01014.89
7.3.30.0000.01314.99
7.3.20.0070.00716.70
7.3.10.0090.00016.62
7.3.00.0110.00316.61
7.2.330.0130.00416.68
7.2.320.0080.01116.70
7.2.310.0110.00716.74
7.2.300.0120.00616.59
7.2.290.0130.00916.58
7.2.250.0100.01015.27
7.2.240.0190.00315.11
7.2.230.0040.01115.19
7.2.220.0090.00615.11
7.2.210.0030.01215.32
7.2.200.0120.00315.28
7.2.190.0100.00315.11
7.2.180.0080.00814.92
7.2.170.0100.00714.98
7.2.60.0030.00317.00
7.2.30.0080.01619.61
7.2.20.0120.01219.82
7.2.10.0090.01920.06
7.2.00.0100.01319.86
7.1.330.0000.01515.55
7.1.320.0030.00715.71
7.1.310.0100.00315.68
7.1.300.0100.00315.81
7.1.290.0030.00915.82
7.1.280.0070.00315.75
7.1.270.0030.00715.88
7.1.260.0070.00716.07
7.1.200.0080.00015.98
7.1.150.0090.01318.75
7.1.140.0070.01018.69
7.1.130.0110.01118.78
7.1.120.0090.01218.70
7.1.110.0090.01218.01
7.1.100.0090.01317.99
7.1.90.0050.01217.91
7.1.80.0080.00818.16
7.1.70.0090.01117.23
7.1.60.0210.01434.98
7.1.50.0290.01534.74
7.1.40.0290.02034.48
7.1.30.0310.01834.37
7.1.20.0320.01434.49
7.1.10.0060.01416.56
7.1.00.0080.01116.60

preferences:
55.36 ms | 400 KiB | 5 Q