3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php echo set_markup(1); function set_markup($total_price) { $total_price = (int)$total_price; switch($total_price) { case ($total_price >= 0 && $total_price <= 9999): $markup_percent = 25; break; case ($total_price >= 10000 && $total_price <= 25000): $markup_percent = 20; break; case ($total_price >= 25001 && $total_price <= 99999): $markup_percent = 15; break; case ($total_price >= 100000 && $total_price <= 999999): $markup_percent = 10; break; case ($total_price >= 1000000 && $total_price <= 20000000): $markup_percent = 5; break; default: $markup_percent = 0; break; } return $markup_percent; }
based on SD7nq
Output for 4.3.0 - 7.1.0
25