3v4l.org

run code in 300+ PHP versions simultaneously
<?php function round_price_with_limits( $price = null, $multiplier = 9.3, $nearest = 10, $minus = 0.05, $map = 9.95, $msrp = 9999999999) { // Ensure a price was provided. if ( !empty( $price ) ) { // Calculate price with markup and round it. $rounded_price = ( ceil ( ( $price * $multiplier ) / $nearest ) * $nearest ) - $minus; // If price is less than minimum, return minimum. if($rounded_price < $map){ return $map; } // If price is greater than maximum, return maximum. elseif($rounded_price > $msrp){ return $msrp; } else { // Return price otherwise. return $rounded_price; } } } echo round_price_with_limits(1.76);

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.5.10.0090.00820.03
8.5.00.0120.00919.87
8.4.150.0020.00114.05
8.4.140.0150.00617.38
8.4.130.0130.00717.65
8.4.120.0100.00820.45
8.4.110.0080.00822.34
8.4.100.0140.00817.79
8.4.90.0080.00817.43
8.4.80.0110.00917.69
8.4.70.0080.00817.71
8.4.60.0130.00817.70
8.4.50.0030.00622.33
8.4.40.0100.01020.26
8.4.30.0100.01018.87
8.4.20.0100.01025.77
8.4.10.0000.01023.84
8.3.280.0120.00818.39
8.3.270.0090.01016.46
8.3.260.0100.00816.52
8.3.250.0120.00718.94
8.3.240.0100.00916.56
8.3.230.0040.00416.41
8.3.220.0130.00517.27
8.3.210.0100.00916.45
8.3.200.0040.00516.67
8.3.190.0130.00516.71
8.3.180.0050.00316.72
8.3.170.0110.00718.97
8.3.160.0140.00419.00
8.3.150.0060.01218.56
8.3.140.0090.00017.04
8.3.130.0050.00318.41
8.3.120.0100.00020.73
8.3.110.0000.00716.50
8.3.100.0100.01016.50
8.3.90.0070.00718.31
8.3.80.0030.00918.30
8.3.70.0150.00418.31
8.3.60.0040.01116.75
8.3.50.0060.01216.44
8.3.40.0030.01020.12
8.3.30.0110.00418.81
8.3.20.0050.00224.18
8.3.10.0030.00524.66
8.3.00.0030.00626.16
8.2.290.0110.00720.51
8.2.280.0120.00718.31
8.2.270.0110.00817.03
8.2.260.0110.00416.62
8.2.250.0050.00218.81
8.2.240.0120.00616.34
8.2.230.0000.00820.94
8.2.220.0150.00424.06
8.2.210.0040.00426.77
8.2.200.0030.00616.50
8.2.190.0040.01118.17
8.2.180.0070.01416.38
8.2.170.0070.01019.09
8.2.160.0070.01022.96
8.2.150.0040.00425.66
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0040.00426.16
8.2.110.0040.00421.16
8.2.100.0080.00417.97
8.2.90.0040.00417.91
8.2.80.0080.00018.04
8.2.70.0050.00317.91
8.2.60.0080.00018.09
8.2.50.0040.00418.10
8.2.40.0030.00719.17
8.2.30.0040.00419.32
8.2.20.0040.00419.30
8.2.10.0050.00218.07
8.2.00.0070.00718.59
8.1.330.0100.00922.08
8.1.320.0110.00915.91
8.1.310.0060.01018.11
8.1.300.0030.00617.82
8.1.290.0040.00418.88
8.1.280.0090.00625.92
8.1.270.0040.00424.66
8.1.260.0040.00426.35
8.1.250.0070.00028.09
8.1.240.0030.00622.08
8.1.230.0080.00322.81
8.1.220.0080.00017.74
8.1.210.0060.00319.95
8.1.200.0100.00017.35
8.1.190.0030.00617.38
8.1.180.0030.00618.10
8.1.170.0080.00018.63
8.1.160.0030.00618.84
8.1.150.0040.00418.57
8.1.140.0000.00717.48
8.1.130.0070.00717.42
8.1.120.0100.00417.56
8.1.110.0090.00617.54
8.1.100.0120.00217.55
8.1.90.0090.00517.54
8.1.80.0100.00417.50
8.1.70.0110.00317.61
8.1.60.0150.00017.67
8.1.50.0120.00517.58
8.1.40.0110.00517.67
8.1.30.0100.00517.71
8.1.20.0120.00417.75
8.1.10.0110.00617.57
8.1.00.0120.00417.52
8.0.300.0070.00020.13
8.0.290.0080.00016.88
8.0.280.0000.00718.53
8.0.270.0000.00717.95
8.0.260.0080.00716.90
8.0.250.0110.00616.94
8.0.240.0160.00416.87
8.0.230.0080.00916.96
8.0.220.0120.00516.85
8.0.210.0120.00416.80
8.0.200.0100.00516.99
8.0.190.0130.00216.88
8.0.180.0130.00116.89
8.0.170.0090.00516.89
8.0.160.0110.00416.90
8.0.150.0070.00816.78
8.0.140.0090.00516.75
8.0.130.0150.00216.79
8.0.120.0130.00316.81
8.0.110.0130.00216.86
8.0.100.0090.00716.91
8.0.90.0110.00416.89
8.0.80.0110.00516.83
8.0.70.0060.00816.89
8.0.60.0110.00316.81
8.0.50.0070.00716.83
8.0.30.0080.00616.83
8.0.20.0110.00316.92
8.0.10.0110.00316.96

preferences:
44.94 ms | 403 KiB | 5 Q