3v4l.org

run code in 300+ PHP versions simultaneously
<?php const THRESHOLD_PRICES = [ 2 => 8.23, 5 => 10.97, 10 => 13.28, 15 => 15.40, 20 => 18.15, 25 => 20.36, 30 => 22.84, 40 => 25.60, 50 => 28.35, 60 => 31.89, 70 => 36.23, 80 => 39.40, 90 => 42.52, 100 => 44.75 ]; function getThresholdPrice(int $search): float { if (isset(THRESHOLD_PRICES[$search])) { return THRESHOLD_PRICES[$search]; } foreach (THRESHOLD_PRICES as $threshold => $price) { if ($threshold > $search) { break; } } return $price; } foreach (range(1, 105, 13) as $test) { printf("%d => %.02f\n", $test, getThresholdPrice($test)); }
Output for git.master, git.master_jit, rfc.property-hooks
1 => 8.23 14 => 15.40 27 => 22.84 40 => 25.60 53 => 31.89 66 => 36.23 79 => 39.40 92 => 44.75 105 => 44.75

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
91.77 ms | 405 KiB | 5 Q